Скачать MetaTrader 5
Авторизуйтесь или зарегистрируйтесь, чтобы добавить комментарий
Сотни статей помогут создать торгового робота. Заходи и изучай!
mqluser4
43
mqluser4 2016.08.12 19:58 

Здравствуйте .


Никто не переносил сети, созданные в Neuroshell  в среду MQL4 ?



 На графике зеленая линия - это  выход обученной  сети .

 А почти ее копия - это , чему она училась Open[i] -Close[i] .

Внутри программной среды  Neuroshell  все хорошо . Сеть достаточно аккуратно обучается.

mqluser4
43
mqluser4 2016.08.12 19:59  

 Для того ,  что бы сеть перенести в среду MQL4 в Neuroshell есть возможность получить код сети

 Выглядит  он так :


/* Для использования сети H:\ns2\03-08-2016\Datann вставьте этот код в вашу программу на языке C. */
/* Этот код приспособлен для простого и быстрого переноса на любой компьютер. */
/* Поэтому вся логика работы описана без использования циклов и динамических массивов, */
/* что могло бы затруднить перенос кодов на разные компиляторы. */
 
#include <math.h>
 
void Fire_Datann(double *inarray, double *outarray)
{
 double netsum;
 double feature2[10];
 double feature3[10];
 double feature4[10];
 
/* inarray[1] - это C1 */
/* inarray[2] - это C2 */
/* inarray[3] - это C3 */
/* inarray[4] - это C4 */
/* inarray[5] - это C5 */
/* inarray[6] - это C6 */
/* inarray[7] - это C7 */
/* inarray[8] - это C8 */
/* inarray[9] - это C9 */
/* inarray[10] - это C10 */
/* inarray[11] - это C11 */
/* inarray[12] - это C12 */
/* outarray[1] - это C13 */
 
if (inarray[0]<-0.0284) inarray[0] = -0.0284;
if (inarray[0]>0.0213) inarray[0] = 0.0213;
inarray[0] =  2 * (inarray[0] + 0.0284) / 0.0497 -1;
 
if (inarray[1]<-0.0361) inarray[1] = -0.0361;
if (inarray[1]>0.0202) inarray[1] = 0.0202;
inarray[1] =  2 * (inarray[1] + 0.0361) / 0.0563 -1;
 
if (inarray[2]<-0.0322) inarray[2] = -0.0322;
if (inarray[2]>0.0235) inarray[2] = 0.0235;
inarray[2] =  2 * (inarray[2] + 0.0322) / 0.0557 -1;
 
if (inarray[3]<-0.0263) inarray[3] = -0.0263;
if (inarray[3]>0.024) inarray[3] = 0.024;
inarray[3] =  2 * (inarray[3] + 0.0263) / 0.0503 -1;
 
if (inarray[4]<-0.0289) inarray[4] = -0.0289;
if (inarray[4]>0.0266) inarray[4] = 0.0266;
inarray[4] =  2 * (inarray[4] + 0.0289) / 0.0555 -1;
 
if (inarray[5]<-0.0278) inarray[5] = -0.0278;
if (inarray[5]>0.0313) inarray[5] = 0.0313;
inarray[5] =  2 * (inarray[5] + 0.0278) / 0.0591 -1;
 
if (inarray[6]<-0.0239) inarray[6] = -0.0239;
if (inarray[6]>0.0274) inarray[6] = 0.0274;
inarray[6] =  2 * (inarray[6] + 0.0239) / 0.0513 -1;
 
if (inarray[7]<-0.0311) inarray[7] = -0.0311;
if (inarray[7]>0.0281) inarray[7] = 0.0281;
inarray[7] =  2 * (inarray[7] + 0.0311) / 0.0592 -1;
 
if (inarray[8]<-0.0286) inarray[8] = -0.0286;
if (inarray[8]>0.0221) inarray[8] = 0.0221;
inarray[8] =  2 * (inarray[8] + 0.0286) / 0.0507 -1;
 
if (inarray[9]<-0.0324) inarray[9] = -0.0324;
if (inarray[9]>0.0237) inarray[9] = 0.0237;
inarray[9] =  2 * (inarray[9] + 0.0324) / 0.0561 -1;
 
if (inarray[10]<-0.0337) inarray[10] = -0.0337;
if (inarray[10]>0.0253) inarray[10] = 0.0253;
inarray[10] =  2 * (inarray[10] + 0.0337) / 0.059 -1;
 
if (inarray[11]<-0.0329) inarray[11] = -0.0329;
if (inarray[11]>0.0267) inarray[11] = 0.0267;
inarray[11] =  2 * (inarray[11] + 0.0329) / 0.0596 -1;
 
netsum = -0.2926169;
netsum += inarray[0] * -0.1915849;
netsum += inarray[1] * 0.2950785;
netsum += inarray[2] * -0.1994414;
netsum += inarray[3] * 0.22058;
netsum += inarray[4] * 0.1679275;
netsum += inarray[5] * -0.0772386;
netsum += inarray[6] * 0.195535;
netsum += inarray[7] * 5.390747E-02;
netsum += inarray[8] * 0.0076667;
netsum += inarray[9] * -0.2136906;
netsum += inarray[10] * -0.2088745;
netsum += inarray[11] * 0.1436908;
feature2[0] = exp(-netsum * netsum);
 
netsum = 3.834743E-02;
netsum += inarray[0] * 0.2152396;
netsum += inarray[1] * -3.258138E-02;
netsum += inarray[2] * 9.770796E-02;
netsum += inarray[3] * 0.1357266;
netsum += inarray[4] * 0.205909;
netsum += inarray[5] * -0.2445171;
netsum += inarray[6] * 0.1353495;
netsum += inarray[7] * -6.896431E-02;
netsum += inarray[8] * 0.2936328;
netsum += inarray[9] * 0.2693276;
netsum += inarray[10] * 0.2259569;
netsum += inarray[11] * -5.726999E-02;
feature2[1] = exp(-netsum * netsum);
 
netsum = -0.1859132;
netsum += inarray[0] * 0.1254748;
netsum += inarray[1] * -0.2292372;
netsum += inarray[2] * -2.961877E-02;
netsum += inarray[3] * 0.2748276;
netsum += inarray[4] * 0.2981748;
netsum += inarray[5] * 0.1068331;
netsum += inarray[6] * -7.410171E-03;
netsum += inarray[7] * 0.1421627;
netsum += inarray[8] * 0.1513817;
netsum += inarray[9] * -0.2145284;
netsum += inarray[10] * 0.1932753;
netsum += inarray[11] * -0.1327487;
feature2[2] = exp(-netsum * netsum);
 
netsum = 0.184762;
netsum += inarray[0] * 7.945916E-03;
netsum += inarray[1] * -0.2970006;
netsum += inarray[2] * -8.871397E-02;
netsum += inarray[3] * 0.2549539;
netsum += inarray[4] * 0.2991956;
netsum += inarray[5] * -0.2667519;
netsum += inarray[6] * -0.1771778;
netsum += inarray[7] * 6.526391E-02;
netsum += inarray[8] * -9.324741E-02;
netsum += inarray[9] * 0.2421288;
netsum += inarray[10] * 4.824708E-02;
netsum += inarray[11] * 3.907825E-02;
feature2[3] = exp(-netsum * netsum);
 
netsum = 0.0530136;
netsum += inarray[0] * -0.1147661;
netsum += inarray[1] * -0.2928574;
netsum += inarray[2] * -0.2644353;
netsum += inarray[3] * 2.142459E-02;
netsum += inarray[4] * 6.752554E-02;
netsum += inarray[5] * -0.2957435;
netsum += inarray[6] * 0.1441754;
netsum += inarray[7] * 4.214849E-02;
netsum += inarray[8] * -0.1991427;
netsum += inarray[9] * 0.1156085;
netsum += inarray[10] * -0.1861574;
netsum += inarray[11] * 0.1116603;
feature2[4] = exp(-netsum * netsum);
 
netsum = -1.089936E-02;
netsum += inarray[0] * -0.292124;
netsum += inarray[1] * -7.284924E-02;
netsum += inarray[2] * 6.484713E-02;
netsum += inarray[3] * -0.2140635;
netsum += inarray[4] * -6.543028E-02;
netsum += inarray[5] * 0.2497744;
netsum += inarray[6] * -2.131443E-02;
netsum += inarray[7] * -8.504173E-02;
netsum += inarray[8] * 9.196115E-02;
netsum += inarray[9] * -0.1211174;
netsum += inarray[10] * -0.195496;
netsum += inarray[11] * 0.1486707;
feature2[5] = exp(-netsum * netsum);
 
netsum = -9.026391E-02;
netsum += inarray[0] * -0.2471828;
netsum += inarray[1] * 1.788831E-02;
netsum += inarray[2] * 0.1696678;
netsum += inarray[3] * -2.265222E-02;
netsum += inarray[4] * -0.1417694;
netsum += inarray[5] * -0.1347742;
netsum += inarray[6] * -2.542252E-02;
netsum += inarray[7] * -0.2097886;
netsum += inarray[8] * -4.180021E-03;
netsum += inarray[9] * -4.267319E-02;
netsum += inarray[10] * 0.1949536;
netsum += inarray[11] * 0.1349994;
feature2[6] = exp(-netsum * netsum);
 
netsum = 0.2370359;
netsum += inarray[0] * -8.144855E-02;
netsum += inarray[1] * 4.244788E-02;
netsum += inarray[2] * 0.1814349;
netsum += inarray[3] * -0.1588673;
netsum += inarray[4] * -0.121687;
netsum += inarray[5] * -0.1362771;
netsum += inarray[6] * 0.2695796;
netsum += inarray[7] * -0.164891;
netsum += inarray[8] * -0.2618145;
netsum += inarray[9] * -0.2576992;
netsum += inarray[10] * -1.471049E-02;
netsum += inarray[11] * -1.468471E-02;
feature2[7] = exp(-netsum * netsum);
 
netsum = 0.1964746;
netsum += inarray[0] * -0.2131571;
netsum += inarray[1] * 6.158954E-02;
netsum += inarray[2] * 1.254971E-02;
netsum += inarray[3] * 0.2179799;
netsum += inarray[4] * 0.2027747;
netsum += inarray[5] * 5.259511E-02;
netsum += inarray[6] * 0.1463405;
netsum += inarray[7] * -4.593632E-02;
netsum += inarray[8] * 0.1191978;
netsum += inarray[9] * 0.2795777;
netsum += inarray[10] * -0.2054285;
netsum += inarray[11] * -0.2289697;
feature2[8] = exp(-netsum * netsum);
 
netsum = 0.1481165;
netsum += inarray[0] * -0.2006304;
netsum += inarray[1] * 6.434827E-02;
netsum += inarray[2] * -0.1187729;
netsum += inarray[3] * -0.1736033;
netsum += inarray[4] * -0.2856021;
netsum += inarray[5] * 0.1151934;
netsum += inarray[6] * -0.2339101;
netsum += inarray[7] * 0.1827698;
netsum += inarray[8] * 3.872039E-03;
netsum += inarray[9] * 0.1108733;
netsum += inarray[10] * 3.013098E-03;
netsum += inarray[11] * -7.883785E-02;
feature2[9] = exp(-netsum * netsum);
 
netsum = -8.287604E-02;
netsum += inarray[0] * 0.1506403;
netsum += inarray[1] * -0.1868469;
netsum += inarray[2] * 0.2634889;
netsum += inarray[3] * -0.2086532;
netsum += inarray[4] * -2.987013E-02;
netsum += inarray[5] * -0.1594919;
netsum += inarray[6] * -9.303835E-02;
netsum += inarray[7] * -0.2672825;
netsum += inarray[8] * -1.919212E-02;
netsum += inarray[9] * 0.1436277;
netsum += inarray[10] * -0.2498939;
netsum += inarray[11] * 0.061353;
feature3[0] = tanh(netsum);
 
netsum = 0.2046546;
netsum += inarray[0] * 0.2001251;
netsum += inarray[1] * 0.2044397;
netsum += inarray[2] * -0.1285452;
netsum += inarray[3] * -0.2955787;
netsum += inarray[4] * 0.1502212;
netsum += inarray[5] * 4.757785E-02;
netsum += inarray[6] * -0.1894112;
netsum += inarray[7] * 0.2388916;
netsum += inarray[8] * 0.0596025;
netsum += inarray[9] * 3.388543E-02;
netsum += inarray[10] * 0.1461795;
netsum += inarray[11] * 0.1323827;
feature3[1] = tanh(netsum);
 
netsum = -0.1030858;
netsum += inarray[0] * -5.527455E-02;
netsum += inarray[1] * 7.893748E-02;
netsum += inarray[2] * -9.722722E-02;
netsum += inarray[3] * -0.2682637;
netsum += inarray[4] * 0.1140004;
netsum += inarray[5] * 1.831368E-02;
netsum += inarray[6] * 0.2923746;
netsum += inarray[7] * -0.1289166;
netsum += inarray[8] * 7.993938E-02;
netsum += inarray[9] * 0.2424952;
netsum += inarray[10] * 6.548363E-02;
netsum += inarray[11] * -0.2664684;
feature3[2] = tanh(netsum);
 
netsum = -2.251307E-02;
netsum += inarray[0] * 3.826975E-03;
netsum += inarray[1] * 9.620101E-02;
netsum += inarray[2] * -0.2152722;
netsum += inarray[3] * 0.181238;
netsum += inarray[4] * 2.741118E-02;
netsum += inarray[5] * 7.663347E-02;
netsum += inarray[6] * -2.825228E-02;
netsum += inarray[7] * -0.1653644;
netsum += inarray[8] * 0.2123161;
netsum += inarray[9] * -0.1546578;
netsum += inarray[10] * 7.122844E-02;
netsum += inarray[11] * 0.1047455;
feature3[3] = tanh(netsum);
 
netsum = -0.130827;
netsum += inarray[0] * 0.2407799;
netsum += inarray[1] * -0.1787056;
netsum += inarray[2] * 0.1407531;
netsum += inarray[3] * 0.2061675;
netsum += inarray[4] * -0.252925;
netsum += inarray[5] * -0.205282;
netsum += inarray[6] * 0.2940291;
netsum += inarray[7] * 0.1576272;
netsum += inarray[8] * 0.1964178;
netsum += inarray[9] * -0.1868332;
netsum += inarray[10] * 0.1135164;
netsum += inarray[11] * 0.2958438;
feature3[4] = tanh(netsum);
 
netsum = 0.2990474;
netsum += inarray[0] * -0.2760746;
netsum += inarray[1] * 0.2092669;
netsum += inarray[2] * 0.2021064;
netsum += inarray[3] * -0.1784073;
netsum += inarray[4] * -3.446544E-02;
netsum += inarray[5] * 1.44409E-03;
netsum += inarray[6] * -0.2465624;
netsum += inarray[7] * -5.649392E-02;
netsum += inarray[8] * 7.407954E-02;
netsum += inarray[9] * 6.231636E-02;
netsum += inarray[10] * 0.1800086;
netsum += inarray[11] * -0.1021208;
feature3[5] = tanh(netsum);
 
netsum = -0.1251344;
netsum += inarray[0] * 0.2939918;
netsum += inarray[1] * -0.2276894;
netsum += inarray[2] * 0.1241019;
netsum += inarray[3] * -0.2287833;
netsum += inarray[4] * -0.1799946;
netsum += inarray[5] * 0.2784155;
netsum += inarray[6] * 7.738594E-02;
netsum += inarray[7] * -0.1772642;
netsum += inarray[8] * 0.1331547;
netsum += inarray[9] * 0.1195902;
netsum += inarray[10] * -0.2094984;
netsum += inarray[11] * 3.865772E-02;
feature3[6] = tanh(netsum);
 
netsum = 0.1367214;
netsum += inarray[0] * 3.766083E-02;
netsum += inarray[1] * -0.2369401;
netsum += inarray[2] * 5.921964E-02;
netsum += inarray[3] * 3.670723E-02;
netsum += inarray[4] * 0.1155345;
netsum += inarray[5] * 0.1185996;
netsum += inarray[6] * -0.2385157;
netsum += inarray[7] * 7.991331E-02;
netsum += inarray[8] * 4.048798E-02;
netsum += inarray[9] * 5.145406E-02;
netsum += inarray[10] * 4.743585E-02;
netsum += inarray[11] * -0.1237777;
feature3[7] = tanh(netsum);
 
netsum = 3.944988E-02;
netsum += inarray[0] * -0.2706315;
netsum += inarray[1] * 0.1455074;
netsum += inarray[2] * 0.1482431;
netsum += inarray[3] * -0.2906975;
netsum += inarray[4] * -0.1261865;
netsum += inarray[5] * 0.2550223;
netsum += inarray[6] * -3.659514E-02;
netsum += inarray[7] * 6.294441E-02;
netsum += inarray[8] * -0.0747641;
netsum += inarray[9] * -8.909108E-02;
netsum += inarray[10] * 0.2209747;
netsum += inarray[11] * -0.1968675;
feature3[8] = tanh(netsum);
 
netsum = -0.1818944;
netsum += inarray[0] * 1.924008E-02;
netsum += inarray[1] * -0.1114063;
netsum += inarray[2] * -0.1483488;
netsum += inarray[3] * -0.2322652;
netsum += inarray[4] * -3.792237E-02;
netsum += inarray[5] * -0.1862219;
netsum += inarray[6] * 0.2584048;
netsum += inarray[7] * -2.933752E-02;
netsum += inarray[8] * -0.1895449;
netsum += inarray[9] * -3.34106E-03;
netsum += inarray[10] * 0.2469115;
netsum += inarray[11] * -0.234179;
feature3[9] = tanh(netsum);
 
netsum = -6.244174E-02;
netsum += inarray[0] * 0.2223945;
netsum += inarray[1] * -0.2591375;
netsum += inarray[2] * 9.611838E-02;
netsum += inarray[3] * 6.348269E-02;
netsum += inarray[4] * -7.299815E-02;
netsum += inarray[5] * 0.2709594;
netsum += inarray[6] * 0.1336635;
netsum += inarray[7] * -9.324235E-02;
netsum += inarray[8] * -0.2125738;
netsum += inarray[9] * 2.825866E-02;
netsum += inarray[10] * 0.1452901;
netsum += inarray[11] * -0.2699838;
feature4[0] = 1 - exp(-netsum * netsum);
 
netsum = -0.1252174;
netsum += inarray[0] * 0.1347519;
netsum += inarray[1] * 0.2248538;
netsum += inarray[2] * -0.2325275;
netsum += inarray[3] * -6.414542E-02;
netsum += inarray[4] * 0.1700641;
netsum += inarray[5] * 6.695963E-02;
netsum += inarray[6] * 0.2131282;
netsum += inarray[7] * -0.1068316;
netsum += inarray[8] * 7.781551E-02;
netsum += inarray[9] * -0.1664843;
netsum += inarray[10] * 6.522956E-02;
netsum += inarray[11] * -0.2560427;
feature4[1] = 1 - exp(-netsum * netsum);
 
netsum = -1.179079E-02;
netsum += inarray[0] * -0.1191287;
netsum += inarray[1] * 9.525086E-02;
netsum += inarray[2] * -3.673276E-03;
netsum += inarray[3] * -0.2988012;
netsum += inarray[4] * 3.079353E-02;
netsum += inarray[5] * -0.2817227;
netsum += inarray[6] * -0.2970958;
netsum += inarray[7] * -8.337485E-02;
netsum += inarray[8] * -6.145128E-02;
netsum += inarray[9] * -0.1169928;
netsum += inarray[10] * -8.716533E-02;
netsum += inarray[11] * 9.233708E-03;
feature4[2] = 1 - exp(-netsum * netsum);
 
netsum = 1.780502E-03;
netsum += inarray[0] * 0.2661224;
netsum += inarray[1] * -0.1066801;
netsum += inarray[2] * -7.275707E-02;
netsum += inarray[3] * 0.1236091;
netsum += inarray[4] * -8.645724E-02;
netsum += inarray[5] * -0.102047;
netsum += inarray[6] * -0.2254563;
netsum += inarray[7] * 9.548719E-02;
netsum += inarray[8] * -0.1483936;
netsum += inarray[9] * -0.234392;
netsum += inarray[10] * 0.2135075;
netsum += inarray[11] * -4.474859E-02;
feature4[3] = 1 - exp(-netsum * netsum);
 
netsum = -0.2010141;
netsum += inarray[0] * -0.2194603;
netsum += inarray[1] * -0.2343075;
netsum += inarray[2] * 1.948836E-04;
netsum += inarray[3] * -0.2409989;
netsum += inarray[4] * 0.2760338;
netsum += inarray[5] * -0.2675648;
netsum += inarray[6] * 0.1219891;
netsum += inarray[7] * 0.1791141;
netsum += inarray[8] * -0.2178448;
netsum += inarray[9] * 0.1863359;
netsum += inarray[10] * -0.1609809;
netsum += inarray[11] * -0.235372;
feature4[4] = 1 - exp(-netsum * netsum);
 
netsum = -0.1091188;
netsum += inarray[0] * -0.2611819;
netsum += inarray[1] * 1.950881E-03;
netsum += inarray[2] * 0.1756206;
netsum += inarray[3] * 7.452866E-02;
netsum += inarray[4] * 7.855026E-02;
netsum += inarray[5] * 8.371487E-02;
netsum += inarray[6] * 7.168619E-02;
netsum += inarray[7] * 0.1851414;
netsum += inarray[8] * 0.2135824;
netsum += inarray[9] * -0.2185424;
netsum += inarray[10] * 0.2188529;
netsum += inarray[11] * -0.1442364;
feature4[5] = 1 - exp(-netsum * netsum);
 
netsum = 0.1442193;
netsum += inarray[0] * 0.1711917;
netsum += inarray[1] * -0.1633747;
netsum += inarray[2] * 5.636695E-03;
netsum += inarray[3] * 0.2174107;
netsum += inarray[4] * -0.1941099;
netsum += inarray[5] * -0.2209789;
netsum += inarray[6] * -0.1704267;
netsum += inarray[7] * 1.524939E-02;
netsum += inarray[8] * -0.2606249;
netsum += inarray[9] * -0.1298508;
netsum += inarray[10] * -0.1627336;
netsum += inarray[11] * 0.2348459;
feature4[6] = 1 - exp(-netsum * netsum);
 
netsum = -0.1085447;
netsum += inarray[0] * 1.685216E-02;
netsum += inarray[1] * -0.1247193;
netsum += inarray[2] * -0.0696717;
netsum += inarray[3] * -4.954096E-03;
netsum += inarray[4] * -7.381687E-02;
netsum += inarray[5] * 0.2087976;
netsum += inarray[6] * -0.2581645;
netsum += inarray[7] * 6.825818E-02;
netsum += inarray[8] * -4.049181E-02;
netsum += inarray[9] * 0.1768986;
netsum += inarray[10] * -0.1456196;
netsum += inarray[11] * -0.1523134;
feature4[7] = 1 - exp(-netsum * netsum);
 
netsum = 0.1957654;
netsum += inarray[0] * 6.205451E-02;
netsum += inarray[1] * 0.2510637;
netsum += inarray[2] * 0.1124302;
netsum += inarray[3] * 0.1512172;
netsum += inarray[4] * -0.2227758;
netsum += inarray[5] * 0.2191888;
netsum += inarray[6] * -0.1963157;
netsum += inarray[7] * 0.1803859;
netsum += inarray[8] * 0.0446474;
netsum += inarray[9] * 0.2375597;
netsum += inarray[10] * 2.720139E-02;
netsum += inarray[11] * -0.2163803;
feature4[8] = 1 - exp(-netsum * netsum);
 
netsum = 0.2755964;
netsum += inarray[0] * 0.2734475;
netsum += inarray[1] * 3.075932E-02;
netsum += inarray[2] * 0.0193332;
netsum += inarray[3] * -1.613905E-03;
netsum += inarray[4] * 0.1458965;
netsum += inarray[5] * 5.821954E-02;
netsum += inarray[6] * 0.0745558;
netsum += inarray[7] * 0.2404211;
netsum += inarray[8] * -0.1186458;
netsum += inarray[9] * 0.1736924;
netsum += inarray[10] * 0.2908297;
netsum += inarray[11] * -0.2255019;
feature4[9] = 1 - exp(-netsum * netsum);
 
netsum = 0.1631671;
netsum += feature2[0] * -0.3091684;
netsum += feature2[1] * -1.415103E-02;
netsum += feature2[2] * 6.934434E-02;
netsum += feature2[3] * -7.753474E-02;
netsum += feature2[4] * -0.2733837;
netsum += feature2[5] * 0.2316203;
netsum += feature2[6] * 0.2198819;
netsum += feature2[7] * -3.300736E-03;
netsum += feature2[8] * -0.1339108;
netsum += feature2[9] * -0.0537384;
netsum += 0.1837855;
netsum += feature3[0] * 0.1920446;
netsum += feature3[1] * 0.1177201;
netsum += feature3[2] * -0.1912366;
netsum += feature3[3] * -0.1044206;
netsum += feature3[4] * -0.2456915;
netsum += feature3[5] * -0.2632776;
netsum += feature3[6] * 7.761956E-02;
netsum += feature3[7] * 0.1887989;
netsum += feature3[8] * 3.594048E-02;
netsum += feature3[9] * -1.346462E-02;
netsum += 0.2213416;
netsum += feature4[0] * -0.2533517;
netsum += feature4[1] * -0.2750493;
netsum += feature4[2] * -0.2743329;
netsum += feature4[3] * -9.939758E-02;
netsum += feature4[4] * 0.2377405;
netsum += feature4[5] * -6.748704E-02;
netsum += feature4[6] * -4.485227E-02;
netsum += feature4[7] * 0.262846;
netsum += feature4[8] * 0.2055465;
netsum += feature4[9] * 1.928629E-02;
outarray[0] = 1 / (1 + exp(-netsum));
 
 
outarray[0] = 0.0497 *  (outarray[0] - .1) / .8  + -0.0284;
if (outarray[0]<-0.0284) outarray[0] = -0.0284;
if (outarray[0]>0.0213) outarray[0] = 0.0213;
 
               
}
mqluser4
43
mqluser4 2016.08.12 20:02  

Индикатор MQL4 с кодом этой сети выглядит  так :


 

#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Red
 #property  indicator_color2  Blue
#property  indicator_width1 2
#property  indicator_width2 3
#property  indicator_style1 0
 
double     Buffer1[];
 double     Buffer2[];
 double netsum;
 double feature2[20];
 double feature3[20];
 double feature4[20];
  double  inarray[20] ,outarray[20] , ttt[20] ;
 
int init()
  {
   SetIndexBuffer(0,Buffer1);
    SetIndexBuffer(1,Buffer2);
   SetIndexStyle(0,DRAW_LINE);
  SetIndexStyle(1,DRAW_LINE);
   return(0);
  }

int start()
  {
  
  
  
        
         
    
 for(int i=0 ;i< 200;i++)
   {
 
  
   inarray[0]= Close[i]-Open[i ];
   inarray[1]= Close[i]-Open[i+1 ];
   inarray[2]= Close[i]-Open[i+2 ];
   inarray[3]= Close[i]-Open[i+3 ];
   inarray[4]= Close[i]-Open[i+4 ];
   inarray[5]= Close[i]-Open[i+5 ];
   inarray[6]= Close[i]-Open[i+6 ];
   inarray[7]= Close[i]-Open[i+7 ];
   inarray[8]= Close[i]-Open[i+8 ];
   inarray[9]= Close[i]-Open[i+9 ];
   inarray[10]= Close[i]-Open[i+10 ];
   inarray[11]= Close[i]-Open[i+11 ];
  inarray[12]= Close[i]-Open[i+12 ];
   

if (inarray[0]<-0.0284) inarray[0] = -0.0284;
if (inarray[0]>0.0213) inarray[0] = 0.0213;
inarray[0] =  2 * (inarray[0] + 0.0284) / 0.0497 -1;
 
if (inarray[1]<-0.0361) inarray[1] = -0.0361;
if (inarray[1]>0.0202) inarray[1] = 0.0202;
inarray[1] =  2 * (inarray[1] + 0.0361) / 0.0563 -1;
 
if (inarray[2]<-0.0322) inarray[2] = -0.0322;
if (inarray[2]>0.0235) inarray[2] = 0.0235;
inarray[2] =  2 * (inarray[2] + 0.0322) / 0.0557 -1;
 
if (inarray[3]<-0.0263) inarray[3] = -0.0263;
if (inarray[3]>0.024) inarray[3] = 0.024;
inarray[3] =  2 * (inarray[3] + 0.0263) / 0.0503 -1;
 
if (inarray[4]<-0.0289) inarray[4] = -0.0289;
if (inarray[4]>0.0266) inarray[4] = 0.0266;
inarray[4] =  2 * (inarray[4] + 0.0289) / 0.0555 -1;
 
if (inarray[5]<-0.0278) inarray[5] = -0.0278;
if (inarray[5]>0.0313) inarray[5] = 0.0313;
inarray[5] =  2 * (inarray[5] + 0.0278) / 0.0591 -1;
 
if (inarray[6]<-0.0239) inarray[6] = -0.0239;
if (inarray[6]>0.0274) inarray[6] = 0.0274;
inarray[6] =  2 * (inarray[6] + 0.0239) / 0.0513 -1;
 
if (inarray[7]<-0.0311) inarray[7] = -0.0311;
if (inarray[7]>0.0281) inarray[7] = 0.0281;
inarray[7] =  2 * (inarray[7] + 0.0311) / 0.0592 -1;
 
if (inarray[8]<-0.0286) inarray[8] = -0.0286;
if (inarray[8]>0.0221) inarray[8] = 0.0221;
inarray[8] =  2 * (inarray[8] + 0.0286) / 0.0507 -1;
 
if (inarray[9]<-0.0324) inarray[9] = -0.0324;
if (inarray[9]>0.0237) inarray[9] = 0.0237;
inarray[9] =  2 * (inarray[9] + 0.0324) / 0.0561 -1;
 
if (inarray[10]<-0.0337) inarray[10] = -0.0337;
if (inarray[10]>0.0253) inarray[10] = 0.0253;
inarray[10] =  2 * (inarray[10] + 0.0337) / 0.059 -1;
 
if (inarray[11]<-0.0329) inarray[11] = -0.0329;
if (inarray[11]>0.0267) inarray[11] = 0.0267;
inarray[11] =  2 * (inarray[11] + 0.0329) / 0.0596 -1;
 
netsum = -0.2926169;
netsum += inarray[0] * -0.1915849;
netsum += inarray[1] * 0.2950785;
netsum += inarray[2] * -0.1994414;
netsum += inarray[3] * 0.22058;
netsum += inarray[4] * 0.1679275;
netsum += inarray[5] * -0.0772386;
netsum += inarray[6] * 0.195535;
netsum += inarray[7] * 5.390747*0.01;
netsum += inarray[8] * 0.0076667;
netsum += inarray[9] * -0.2136906;
netsum += inarray[10] * -0.2088745;
netsum += inarray[11] * 0.1436908;
feature2[0] = MathExp(-netsum * netsum);
 
netsum = 3.834743*0.01;
netsum += inarray[0] * 0.2152396;
netsum += inarray[1] * -3.258138*0.01;
netsum += inarray[2] * 9.770796*0.01;
netsum += inarray[3] * 0.1357266;
netsum += inarray[4] * 0.205909;
netsum += inarray[5] * -0.2445171;
netsum += inarray[6] * 0.1353495;
netsum += inarray[7] * -6.896431*0.01;
netsum += inarray[8] * 0.2936328;
netsum += inarray[9] * 0.2693276;
netsum += inarray[10] * 0.2259569;
netsum += inarray[11] * -5.726999*0.01;
feature2[1] = MathExp(-netsum * netsum);
 
netsum = -0.1859132;
netsum += inarray[0] * 0.1254748;
netsum += inarray[1] * -0.2292372;
netsum += inarray[2] * -2.961877*0.01;
netsum += inarray[3] * 0.2748276;
netsum += inarray[4] * 0.2981748;
netsum += inarray[5] * 0.1068331;
netsum += inarray[6] * -7.410171*0.001;
netsum += inarray[7] * 0.1421627;
netsum += inarray[8] * 0.1513817;
netsum += inarray[9] * -0.2145284;
netsum += inarray[10] * 0.1932753;
netsum += inarray[11] * -0.1327487;
feature2[2] = MathExp(-netsum * netsum);
 
netsum = 0.184762;
netsum += inarray[0] * 7.945916*0.001;
netsum += inarray[1] * -0.2970006;
netsum += inarray[2] * -8.871397*0.01;
netsum += inarray[3] * 0.2549539;
netsum += inarray[4] * 0.2991956;
netsum += inarray[5] * -0.2667519;
netsum += inarray[6] * -0.1771778;
netsum += inarray[7] * 6.526391*0.01;
netsum += inarray[8] * -9.324741*0.01;
netsum += inarray[9] * 0.2421288;
netsum += inarray[10] * 4.824708*0.01;
netsum += inarray[11] * 3.907825*0.01;
feature2[3] = MathExp(-netsum * netsum);
 
netsum = 0.0530136;
netsum += inarray[0] * -0.1147661;
netsum += inarray[1] * -0.2928574;
netsum += inarray[2] * -0.2644353;
netsum += inarray[3] * 2.142459*0.01;
netsum += inarray[4] * 6.752554*0.01;
netsum += inarray[5] * -0.2957435;
netsum += inarray[6] * 0.1441754;
netsum += inarray[7] * 4.214849*0.01;
netsum += inarray[8] * -0.1991427;
netsum += inarray[9] * 0.1156085;
netsum += inarray[10] * -0.1861574;
netsum += inarray[11] * 0.1116603;
feature2[4] = MathExp(-netsum * netsum);
 
netsum = -1.089936*0.01;
netsum += inarray[0] * -0.292124;
netsum += inarray[1] * -7.284924*0.01;
netsum += inarray[2] * 6.484713*0.01;
netsum += inarray[3] * -0.2140635;
netsum += inarray[4] * -6.543028*0.01;
netsum += inarray[5] * 0.2497744;
netsum += inarray[6] * -2.131443*0.01;
netsum += inarray[7] * -8.504173*0.01;
netsum += inarray[8] * 9.196115*0.01;
netsum += inarray[9] * -0.1211174;
netsum += inarray[10] * -0.195496;
netsum += inarray[11] * 0.1486707;
feature2[5] = MathExp(-netsum * netsum);
 
netsum = -9.026391*0.01;
netsum += inarray[0] * -0.2471828;
netsum += inarray[1] * 1.788831*0.01;
netsum += inarray[2] * 0.1696678;
netsum += inarray[3] * -2.265222*0.01;
netsum += inarray[4] * -0.1417694;
netsum += inarray[5] * -0.1347742;
netsum += inarray[6] * -2.542252*0.01;
netsum += inarray[7] * -0.2097886;
netsum += inarray[8] * -4.180021*0.001;
netsum += inarray[9] * -4.267319*0.01;
netsum += inarray[10] * 0.1949536;
netsum += inarray[11] * 0.1349994;
feature2[6] = MathExp(-netsum * netsum);
 
netsum = 0.2370359;
netsum += inarray[0] * -8.144855*0.01;
netsum += inarray[1] * 4.244788*0.01;
netsum += inarray[2] * 0.1814349;
netsum += inarray[3] * -0.1588673;
netsum += inarray[4] * -0.121687;
netsum += inarray[5] * -0.1362771;
netsum += inarray[6] * 0.2695796;
netsum += inarray[7] * -0.164891;
netsum += inarray[8] * -0.2618145;
netsum += inarray[9] * -0.2576992;
netsum += inarray[10] * -1.471049*0.01;
netsum += inarray[11] * -1.468471*0.01;
feature2[7] = MathExp(-netsum * netsum);
 
netsum = 0.1964746;
netsum += inarray[0] * -0.2131571;
netsum += inarray[1] * 6.158954*0.01;
netsum += inarray[2] * 1.254971*0.01;
netsum += inarray[3] * 0.2179799;
netsum += inarray[4] * 0.2027747;
netsum += inarray[5] * 5.259511*0.01;
netsum += inarray[6] * 0.1463405;
netsum += inarray[7] * -4.593632*0.01;
netsum += inarray[8] * 0.1191978;
netsum += inarray[9] * 0.2795777;
netsum += inarray[10] * -0.2054285;
netsum += inarray[11] * -0.2289697;
feature2[8] = MathExp(-netsum * netsum);
 
netsum = 0.1481165;
netsum += inarray[0] * -0.2006304;
netsum += inarray[1] * 6.434827*0.01;
netsum += inarray[2] * -0.1187729;
netsum += inarray[3] * -0.1736033;
netsum += inarray[4] * -0.2856021;
netsum += inarray[5] * 0.1151934;
netsum += inarray[6] * -0.2339101;
netsum += inarray[7] * 0.1827698;
netsum += inarray[8] * 3.872039*0.001;
netsum += inarray[9] * 0.1108733;
netsum += inarray[10] * 3.013098*0.001;
netsum += inarray[11] * -7.883785*0.01;
feature2[9] = MathExp(-netsum * netsum);
 
netsum = -8.287604*0.01;
netsum += inarray[0] * 0.1506403;
netsum += inarray[1] * -0.1868469;
netsum += inarray[2] * 0.2634889;
netsum += inarray[3] * -0.2086532;
netsum += inarray[4] * -2.987013*0.01;
netsum += inarray[5] * -0.1594919;
netsum += inarray[6] * -9.303835*0.01;
netsum += inarray[7] * -0.2672825;
netsum += inarray[8] * -1.919212*0.01;
netsum += inarray[9] * 0.1436277;
netsum += inarray[10] * -0.2498939;
netsum += inarray[11] * 0.061353;
feature3[0] = MathTan(netsum);
 
netsum = 0.2046546;
netsum += inarray[0] * 0.2001251;
netsum += inarray[1] * 0.2044397;
netsum += inarray[2] * -0.1285452;
netsum += inarray[3] * -0.2955787;
netsum += inarray[4] * 0.1502212;
netsum += inarray[5] * 4.757785*0.01;
netsum += inarray[6] * -0.1894112;
netsum += inarray[7] * 0.2388916;
netsum += inarray[8] * 0.0596025;
netsum += inarray[9] * 3.388543*0.01;
netsum += inarray[10] * 0.1461795;
netsum += inarray[11] * 0.1323827;
feature3[1] = MathTan(netsum);
 
netsum = -0.1030858;
netsum += inarray[0] * -5.527455*0.01;
netsum += inarray[1] * 7.893748*0.01;
netsum += inarray[2] * -9.722722*0.01;
netsum += inarray[3] * -0.2682637;
netsum += inarray[4] * 0.1140004;
netsum += inarray[5] * 1.831368*0.01;
netsum += inarray[6] * 0.2923746;
netsum += inarray[7] * -0.1289166;
netsum += inarray[8] * 7.993938*0.01;
netsum += inarray[9] * 0.2424952;
netsum += inarray[10] * 6.548363*0.01;
netsum += inarray[11] * -0.2664684;
feature3[2] = MathTan(netsum);
 
netsum = -2.251307*0.01;
netsum += inarray[0] * 3.826975*0.001;
netsum += inarray[1] * 9.620101*0.01;
netsum += inarray[2] * -0.2152722;
netsum += inarray[3] * 0.181238;
netsum += inarray[4] * 2.741118*0.01;
netsum += inarray[5] * 7.663347*0.01;
netsum += inarray[6] * -2.825228*0.01;
netsum += inarray[7] * -0.1653644;
netsum += inarray[8] * 0.2123161;
netsum += inarray[9] * -0.1546578;
netsum += inarray[10] * 7.122844*0.01;
netsum += inarray[11] * 0.1047455;
feature3[3] = MathTan(netsum);
 
netsum = -0.130827;
netsum += inarray[0] * 0.2407799;
netsum += inarray[1] * -0.1787056;
netsum += inarray[2] * 0.1407531;
netsum += inarray[3] * 0.2061675;
netsum += inarray[4] * -0.252925;
netsum += inarray[5] * -0.205282;
netsum += inarray[6] * 0.2940291;
netsum += inarray[7] * 0.1576272;
netsum += inarray[8] * 0.1964178;
netsum += inarray[9] * -0.1868332;
netsum += inarray[10] * 0.1135164;
netsum += inarray[11] * 0.2958438;
feature3[4] = MathTan(netsum);
 
netsum = 0.2990474;
netsum += inarray[0] * -0.2760746;
netsum += inarray[1] * 0.2092669;
netsum += inarray[2] * 0.2021064;
netsum += inarray[3] * -0.1784073;
netsum += inarray[4] * -3.446544*0.01;
netsum += inarray[5] * 1.44409*0.001;
netsum += inarray[6] * -0.2465624;
netsum += inarray[7] * -5.649392*0.01;
netsum += inarray[8] * 7.407954*0.01;
netsum += inarray[9] * 6.231636*0.01;
netsum += inarray[10] * 0.1800086;
netsum += inarray[11] * -0.1021208;
feature3[5] = MathTan(netsum);
 
netsum = -0.1251344;
netsum += inarray[0] * 0.2939918;
netsum += inarray[1] * -0.2276894;
netsum += inarray[2] * 0.1241019;
netsum += inarray[3] * -0.2287833;
netsum += inarray[4] * -0.1799946;
netsum += inarray[5] * 0.2784155;
netsum += inarray[6] * 7.738594*0.01;
netsum += inarray[7] * -0.1772642;
netsum += inarray[8] * 0.1331547;
netsum += inarray[9] * 0.1195902;
netsum += inarray[10] * -0.2094984;
netsum += inarray[11] * 3.865772*0.01;
feature3[6] = MathTan(netsum);
 
netsum = 0.1367214;
netsum += inarray[0] * 3.766083*0.01;
netsum += inarray[1] * -0.2369401;
netsum += inarray[2] * 5.921964*0.01;
netsum += inarray[3] * 3.670723*0.01;
netsum += inarray[4] * 0.1155345;
netsum += inarray[5] * 0.1185996;
netsum += inarray[6] * -0.2385157;
netsum += inarray[7] * 7.991331*0.01;
netsum += inarray[8] * 4.048798*0.01;
netsum += inarray[9] * 5.145406*0.01;
netsum += inarray[10] * 4.743585*0.01;
netsum += inarray[11] * -0.1237777;
feature3[7] = MathTan(netsum);
 
netsum = 3.944988*0.01;
netsum += inarray[0] * -0.2706315;
netsum += inarray[1] * 0.1455074;
netsum += inarray[2] * 0.1482431;
netsum += inarray[3] * -0.2906975;
netsum += inarray[4] * -0.1261865;
netsum += inarray[5] * 0.2550223;
netsum += inarray[6] * -3.659514*0.01;
netsum += inarray[7] * 6.294441*0.01;
netsum += inarray[8] * -0.0747641;
netsum += inarray[9] * -8.909108*0.01;
netsum += inarray[10] * 0.2209747;
netsum += inarray[11] * -0.1968675;
feature3[8] = MathTan(netsum);
 
netsum = -0.1818944;
netsum += inarray[0] * 1.924008*0.01;
netsum += inarray[1] * -0.1114063;
netsum += inarray[2] * -0.1483488;
netsum += inarray[3] * -0.2322652;
netsum += inarray[4] * -3.792237*0.01;
netsum += inarray[5] * -0.1862219;
netsum += inarray[6] * 0.2584048;
netsum += inarray[7] * -2.933752*0.01;
netsum += inarray[8] * -0.1895449;
netsum += inarray[9] * -3.34106*0.001;
netsum += inarray[10] * 0.2469115;
netsum += inarray[11] * -0.234179;
feature3[9] = MathTan(netsum);
 
netsum = -6.244174*0.01;
netsum += inarray[0] * 0.2223945;
netsum += inarray[1] * -0.2591375;
netsum += inarray[2] * 9.611838*0.01;
netsum += inarray[3] * 6.348269*0.01;
netsum += inarray[4] * -7.299815*0.01;
netsum += inarray[5] * 0.2709594;
netsum += inarray[6] * 0.1336635;
netsum += inarray[7] * -9.324235*0.01;
netsum += inarray[8] * -0.2125738;
netsum += inarray[9] * 2.825866*0.01;
netsum += inarray[10] * 0.1452901;
netsum += inarray[11] * -0.2699838;
feature4[0] = 1 - MathExp(-netsum * netsum);
 
netsum = -0.1252174;
netsum += inarray[0] * 0.1347519;
netsum += inarray[1] * 0.2248538;
netsum += inarray[2] * -0.2325275;
netsum += inarray[3] * -6.414542*0.01;
netsum += inarray[4] * 0.1700641;
netsum += inarray[5] * 6.695963*0.01;
netsum += inarray[6] * 0.2131282;
netsum += inarray[7] * -0.1068316;
netsum += inarray[8] * 7.781551*0.01;
netsum += inarray[9] * -0.1664843;
netsum += inarray[10] * 6.522956*0.01;
netsum += inarray[11] * -0.2560427;
feature4[1] = 1 - MathExp(-netsum * netsum);
 
netsum = -1.179079*0.01;
netsum += inarray[0] * -0.1191287;
netsum += inarray[1] * 9.525086*0.01;
netsum += inarray[2] * -3.673276*0.001;
netsum += inarray[3] * -0.2988012;
netsum += inarray[4] * 3.079353*0.01;
netsum += inarray[5] * -0.2817227;
netsum += inarray[6] * -0.2970958;
netsum += inarray[7] * -8.337485*0.01;
netsum += inarray[8] * -6.145128*0.01;
netsum += inarray[9] * -0.1169928;
netsum += inarray[10] * -8.716533*0.01;
netsum += inarray[11] * 9.233708*0.001;
feature4[2] = 1 - MathExp(-netsum * netsum);
 
netsum = 1.780502*0.001;
netsum += inarray[0] * 0.2661224;
netsum += inarray[1] * -0.1066801;
netsum += inarray[2] * -7.275707*0.01;
netsum += inarray[3] * 0.1236091;
netsum += inarray[4] * -8.645724*0.01;
netsum += inarray[5] * -0.102047;
netsum += inarray[6] * -0.2254563;
netsum += inarray[7] * 9.548719*0.01;
netsum += inarray[8] * -0.1483936;
netsum += inarray[9] * -0.234392;
netsum += inarray[10] * 0.2135075;
netsum += inarray[11] * -4.474859*0.01;
feature4[3] = 1 - MathExp(-netsum * netsum);
 
netsum = -0.2010141;
netsum += inarray[0] * -0.2194603;
netsum += inarray[1] * -0.2343075;
netsum += inarray[2] * 1.948836E-04;
netsum += inarray[3] * -0.2409989;
netsum += inarray[4] * 0.2760338;
netsum += inarray[5] * -0.2675648;
netsum += inarray[6] * 0.1219891;
netsum += inarray[7] * 0.1791141;
netsum += inarray[8] * -0.2178448;
netsum += inarray[9] * 0.1863359;
netsum += inarray[10] * -0.1609809;
netsum += inarray[11] * -0.235372;
feature4[4] = 1 - MathExp(-netsum * netsum);
 
netsum = -0.1091188;
netsum += inarray[0] * -0.2611819;
netsum += inarray[1] * 1.950881*0.001;
netsum += inarray[2] * 0.1756206;
netsum += inarray[3] * 7.452866*0.01;
netsum += inarray[4] * 7.855026*0.01;
netsum += inarray[5] * 8.371487*0.01;
netsum += inarray[6] * 7.168619*0.01;
netsum += inarray[7] * 0.1851414;
netsum += inarray[8] * 0.2135824;
netsum += inarray[9] * -0.2185424;
netsum += inarray[10] * 0.2188529;
netsum += inarray[11] * -0.1442364;
feature4[5] = 1 - MathExp(-netsum * netsum);
 
netsum = 0.1442193;
netsum += inarray[0] * 0.1711917;
netsum += inarray[1] * -0.1633747;
netsum += inarray[2] * 5.636695*0.001;
netsum += inarray[3] * 0.2174107;
netsum += inarray[4] * -0.1941099;
netsum += inarray[5] * -0.2209789;
netsum += inarray[6] * -0.1704267;
netsum += inarray[7] * 1.524939*0.01;
netsum += inarray[8] * -0.2606249;
netsum += inarray[9] * -0.1298508;
netsum += inarray[10] * -0.1627336;
netsum += inarray[11] * 0.2348459;
feature4[6] = 1 - MathExp(-netsum * netsum);
 
netsum = -0.1085447;
netsum += inarray[0] * 1.685216*0.01;
netsum += inarray[1] * -0.1247193;
netsum += inarray[2] * -0.0696717;
netsum += inarray[3] * -4.954096*0.001;
netsum += inarray[4] * -7.381687*0.01;
netsum += inarray[5] * 0.2087976;
netsum += inarray[6] * -0.2581645;
netsum += inarray[7] * 6.825818*0.01;
netsum += inarray[8] * -4.049181*0.01;
netsum += inarray[9] * 0.1768986;
netsum += inarray[10] * -0.1456196;
netsum += inarray[11] * -0.1523134;
feature4[7] = 1 - MathExp(-netsum * netsum);
 
netsum = 0.1957654;
netsum += inarray[0] * 6.205451*0.01;
netsum += inarray[1] * 0.2510637;
netsum += inarray[2] * 0.1124302;
netsum += inarray[3] * 0.1512172;
netsum += inarray[4] * -0.2227758;
netsum += inarray[5] * 0.2191888;
netsum += inarray[6] * -0.1963157;
netsum += inarray[7] * 0.1803859;
netsum += inarray[8] * 0.0446474;
netsum += inarray[9] * 0.2375597;
netsum += inarray[10] * 2.720139*0.01;
netsum += inarray[11] * -0.2163803;
feature4[8] = 1 - MathExp(-netsum * netsum);
 
netsum = 0.2755964;
netsum += inarray[0] * 0.2734475;
netsum += inarray[1] * 3.075932*0.01;
netsum += inarray[2] * 0.0193332;
netsum += inarray[3] * -1.613905*0.001;
netsum += inarray[4] * 0.1458965;
netsum += inarray[5] * 5.821954*0.01;
netsum += inarray[6] * 0.0745558;
netsum += inarray[7] * 0.2404211;
netsum += inarray[8] * -0.1186458;
netsum += inarray[9] * 0.1736924;
netsum += inarray[10] * 0.2908297;
netsum += inarray[11] * -0.2255019;
feature4[9] = 1 - MathExp(-netsum * netsum);
 
netsum = 0.1631671;
netsum += feature2[0] * -0.3091684;
netsum += feature2[1] * -1.415103*0.01;
netsum += feature2[2] * 6.934434*0.01;
netsum += feature2[3] * -7.753474*0.01;
netsum += feature2[4] * -0.2733837;
netsum += feature2[5] * 0.2316203;
netsum += feature2[6] * 0.2198819;
netsum += feature2[7] * -3.300736*0.001;
netsum += feature2[8] * -0.1339108;
netsum += feature2[9] * -0.0537384;
netsum += 0.1837855;
netsum += feature3[0] * 0.1920446;
netsum += feature3[1] * 0.1177201;
netsum += feature3[2] * -0.1912366;
netsum += feature3[3] * -0.1044206;
netsum += feature3[4] * -0.2456915;
netsum += feature3[5] * -0.2632776;
netsum += feature3[6] * 7.761956*0.01;
netsum += feature3[7] * 0.1887989;
netsum += feature3[8] * 3.594048*0.01;
netsum += feature3[9] * -1.346462*0.01;
netsum += 0.2213416;
netsum += feature4[0] * -0.2533517;
netsum += feature4[1] * -0.2750493;
netsum += feature4[2] * -0.2743329;
netsum += feature4[3] * -9.939758*0.01;
netsum += feature4[4] * 0.2377405;
netsum += feature4[5] * -6.748704*0.01;
netsum += feature4[6] * -4.485227*0.01;
netsum += feature4[7] * 0.262846;
netsum += feature4[8] * 0.2055465;
netsum += feature4[9] * 1.928629*0.01;
outarray[0] = 1 / (1 + MathExp(-netsum));
 
 
outarray[0] = 0.0497 *  (outarray[0] - .1) / .8  + -0.0284;
if (outarray[0]<-0.0284) outarray[0] = -0.0284;
if (outarray[0]>0.0213) outarray[0] = 0.0213;
   
        Buffer2[i]= outarray[0]   ;
       
       
        Buffer1[i]=Close[i -1 ] - Open[i-1  ];
  
      
   }
   
         
         
         

         return(0);
  }
mqluser4
43
mqluser4 2016.08.12 20:06  

А результат работы индикатора так



 Синяя - это работа сети . Выглядит далеко не так ,  как в самом Neuroshell 2



 где выход сети почти повторяет сигнал для  обучения .


  Кому удавалось переносить код сети  без искажения  в  MQL4   и в чем может быть  проблема в данном случае ?

Vitalie Postolache
11583
Vitalie Postolache 2016.08.12 20:45  

А ничего, что  в Buffer1[i]=Close[i-1] - Open[i-1]; данных ещё нет, это будущее?

Не смущает, что терминал выдает ошибку выхода за пределы массива?

Хотя, даже если исправить код, всё равно линии далеко не совпадают.

mqluser4
43
mqluser4 2016.08.13 07:21  

Это сделано специально, что бы на графике отобразить разницу цен на 1 бар из будущего .

Вот ее то и должна рисовать сеть нейрошела так же  хорошо , как у себя дома


Практически повторять с учетом небольшой ошибки обучения .


Ошибка в терминале не мешает нарисовать  график .

Для устранения ошибки достаточно не вылезать  за пределы массива .

Но суть в другом  ,  почему и за счет чего вычисления так исказились , что теряют всякий смысл .

mqluser4
43
mqluser4 2016.08.13 07:27  
evillive:

А ничего, что  в Buffer1[i]=Close[i-1] - Open[i-1]; данных ещё нет, это будущее?

Не смущает, что терминал выдает ошибку выхода за пределы массива?

Хотя, даже если исправить код, всё равно линии далеко не совпадают.


 Именно оно !

 Данные нарисует сеть ( именно  этому ее и учили ) , а в среде терминала их конечно нет , так как мы обратились  за пределы массива

Тем не менее , для второго бара первый является будущим - это используется для построения обучающей  выборки .


 //---- Входы сети
   inarray[0]=Close[i]-Open[i+3];
   inarray[1]=Close[i]-Open[i+2];
   inarray[2]=Close[i]-Open[i+1];
   inarray[3]=Close[i]-Open[i ];

 //---- Выхо для обучения 
   inarray[4]=Close[i-1]-Open[i-1 ];
    
mqluser4
43
mqluser4 2016.08.13 07:45  

Слева - то что генерирует на С нейрошел                                                        А тут код адаптированный под MQL4 с теми же цифрами



Может быть 5.894932Е-02    не  равно 5.894932/100  ?

И ошибка накапливается ?

mqluser4
43
mqluser4 2016.08.13 07:55  



 Синяя кривая ( выход сети ) должна практически повторять красную  ( учитель ) - поскольку   код вычислений один и то же




 Может быть нейрошелл генерирует  не качественный исходник сети ?

 Либо вычисления в  MQL4 c 7  знаками после запятой накапливают  искажения ?

  Кто думает еще ?









mqluser4
43
mqluser4 2016.08.13 08:06  
//+-------------------------------------------------------------------------+
//|                                     Подготовка данных для нейрошела.mq4 |
//+-------------------------------------------------------------------------+
#property show_inputs
//---
//#include <stdlib.mqh>
//----
extern string Name="DataNS2-DAY-13-07-2016.txt";//Имя файла с выгружеными данными
extern datetime time_start=D'2016.01.01 00:00';//Время начала
 
 
 double inarray[40], outarray[40]  ;
//-------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
  //----
  int i;
  int start=iBarShift(NULL,0,time_start);//поиск бара, с которого начинается выгрузка
 
  int handle=FileOpen(Name, FILE_CSV|FILE_WRITE,'\t');
  if(handle>0)
  {
//----
   for(i=400;i>0;i--){
 
   //---- Входы сети
   inarray[0]=Close[i]-Open[i+3];
   inarray[1]=Close[i]-Open[i+2];
   inarray[2]=Close[i]-Open[i+1];
   inarray[3]=Close[i]-Open[i ];
   //---- Выход для обучения 
    inarray[4]=Close[i-1]-Open[i-1 ];
    
   //---- Запись данных в файл
   FileWrite(handle,inarray[0],inarray[1],inarray[2],   inarray[3],inarray[4]  );
    //---- Комментарий
   Comment("Выполнено:  ",100-100*i/start," %"); 
//----
   }
     Print(" Записано= ", start-1," паттернов"); 
     FileFlush(handle);
     FileClose(handle);
  }
 
//----
 
   return(0);
  }


Скрипт для подготовки  данных . Использовал готовый .

Vitalie Postolache
11583
Vitalie Postolache 2016.08.13 09:14  
mqluser4:

Слева - то что генерирует на С нейрошел                                                        А тут код адаптированный под MQL4 с теми же цифрами



Может быть 5.894932Е-02    не  равно 5.894932/100  ?

И ошибка накапливается ?

Равно, вы даже могли оставить в виде  5.894932Е-02, компилятор понимает такой вид написания. И даже не было необходимости exp() менять на MathExp(), да и tan() вполне работает. 

Не в этом ошибка. Скорее всего данные для тренировки сети не совсем соответствуют котировкам в терминале. 

А какой практический смысл в сети, которая всего лишь повторяет входные данные? Стоит ли оно того?

/ /123
Авторизуйтесь или зарегистрируйтесь, чтобы добавить комментарий