Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PtnBaseSa //
- ///////////////////INIZIO CREAZIONE STRUTTURA FUNZIONE EASYLANGUAGE //////////////////////
- // Creare Una Nuova Funzione Di Tipo Buleano Alla Sua Creazione Atrimenti Non Funziona //
- // Inizio Codifica di tutti i pattern base Unger Easylanguage //
- // Il nome della funzione appena creata deve essere uguale al nome che ritorna le funzione nel codice //
- {[Legacycolorvalue = true];
- input: numeropattern(Numericsimple);
- array: definizioneptn[200](false);
- var:opend0(0),opend1(0),opend2(0),opend3(0),opend4(0),opend5(0);
- var:highd0(0),highd1(0),highd2(0),highd3(0),highd4(0),highd5(0);
- var:lowd0(0),lowd1(0),lowd2(0),lowd3(0),lowd4(0),lowd5(0);
- var:closed0(0),closed1(0),closed2(0),closed3(0),closed4(0),closed5(0);
- // Valori in parentesi Session: (1=regular session, 0=all sessions), (Number of session ago to reference price (0 = current session).
- opend0 = opend(0); // "opens forse opensession"
- opend1 = opend(1); // "opens forse opensession"
- opend2 = opend(2); // "opens forse opensession"
- opend3 = opend(3); // "opens forse opensession"
- opend4 = opend(4); // "opens forse opensession"
- opend5 = opend(5); // "opens forse opensession"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- highd0 = highd(0); // "highs forse highsession"
- highd1 = highd(1); // "highs forse highsession"
- highd2 = highd(2); // "highs forse highsession"
- highd3 = highd(3); // "highs forse highsession"
- highd4 = highd(4); // "highs forse highsession"
- highd5 = highd(5); // "highs forse highsession"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- lowd0 = lowd(0); // "lows forse lowsession"
- lowd1 = lowd(1); // "lows forse lowsession"
- lowd2 = lowd(2); // "lows forse lowsession"
- lowd3 = lowd(3); // "lows forse lowsession"
- lowd4 = lowd(4); // "lows forse lowsession"
- lowd5 = lowd(5); // "lows forse lowsession"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- closed0 = closed(0); // "closes forse closesession"
- closed1 = closed(1); // "closes forse closesession"
- closed2 = closed(2); // "closes forse closesession"
- closed3 = closed(3); // "closes forse closesession"
- closed4 = closed(4); // "closes forse closesession"
- closed5 = closed(5); // "closes forse closesession"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- // Per i range settimanali delle criptovalute alcuni pattern vanno estesi a 7 vedi video Unger //
- definizioneptn[1] = absvalue(opend1-closed1)<0.5*(highd1-lowd1) ;
- definizioneptn[2] = absvalue(opend1-closed5)<0.5*(highd5-closed1) ;
- definizioneptn[3] = absvalue(opend5-closed1)<0.5*(maxlist(highd1,highd2,highd3,highd4,highd5)-(minlist(lowd1,lowd2,lowd3,lowd4,lowd5))) ;
- definizioneptn[4] = ((highd0-opend0)> ((highd1-opend1)*1)) ;
- definizioneptn[5] = ((highd0-opend0)> ((highd1-opend1)*1.5)) ;
- definizioneptn[6] = ((opend0-lowd0)> ((opend1-lowd1)*1)) ;
- definizioneptn[7] = ((opend0-lowd0)> ((opend1-lowd1)*1.5)) ;
- definizioneptn[8] = closed1>closed2 and closed2>closed3 and closed3>closed4 ;
- definizioneptn[9] = closed1<closed2 and closed2<closed3 and closed3<closed4 ;
- definizioneptn[10] = highd1>highd2 and lowd1>lowd2 ;
- definizioneptn[11] = highd1<highd2 and lowd1<lowd2 ;
- definizioneptn[12] = ((highd0>(lowd0+lowd0*0.75/100))) ;
- definizioneptn[13] = ((highd0<(lowd0+lowd0*0.75/100))) ;
- definizioneptn[14] = (closed1>closed2) ;
- definizioneptn[15] = (closed1<closed2) ;
- definizioneptn[16] = (closed1<opend1) ;
- definizioneptn[17] = (closed1>opend1) ;
- definizioneptn[18] = ((closed1<(closed2-closed2*0.5/100))) ;
- definizioneptn[19] = ((closed1>(closed2+closed2*0.5/100))) ;
- definizioneptn[20] = (highd0>(highd1)) ;
- definizioneptn[21] = (highd1>highd5) ;
- definizioneptn[22] = (lowd0<lowd1) ;
- definizioneptn[23] = (lowd1<lowd5) ;
- definizioneptn[24] = (highd1>highd2) and (highd1>highd3) and (highd1>highd4) ;
- definizioneptn[25] = (highd1<highd2) and (highd1<highd3) and (highd1<highd4) ;
- definizioneptn[26] = ((lowd1<lowd2) and (lowd1<lowd3) and (lowd1<lowd4)) ;
- definizioneptn[27] = ((lowd1>lowd2) and (lowd1>lowd3) and (lowd1<lowd4)) ;
- definizioneptn[28] = (closed1>closed2 and closed2>closed3 and opend0>closed1) ;
- definizioneptn[29] = (closed1<closed2 and closed2<closed3 and opend0<closed1) ;
- definizioneptn[30] = ((highd1-closed1)<0.20*(highd1-lowd1)) ;
- definizioneptn[31] = ((closed1-lowd1)<0.20*(highd1-lowd1)) ;
- definizioneptn[32] = (opend0<lowd1 or opend0>highd1) ;
- definizioneptn[33] = ((opend0<(closed1-closed1*0.5/100))) ;
- definizioneptn[34] = ((opend0>(closed1+closed1*0.5/100))) ;
- definizioneptn[35] = (highd0<highd1 and lowd0>lowd1) ;
- definizioneptn[36] = (highd1-lowd1)<((highd2-lowd2)+(highd3-lowd3))/3 ;
- definizioneptn[37] = (highd1-lowd1)<(highd2-lowd2) and (highd2-lowd2)<(highd3-lowd3) ;
- definizioneptn[38] = (highd2>highd1 and lowd2<lowd1) ;
- definizioneptn[39] = (highd1<highd2 or lowd1>lowd2) ;
- definizioneptn[40] = (highd2<highd1 and lowd2>lowd1) ;
- definizioneptn[41] = true ;
- definizioneptn[42] = false ;
- PtnBaseSA = definizioneptn[numeropattern];}
- ///////////////////FINE CREAZIONE STRUTTURA FUNZIONE EASYLANGUAGE //////////////////////
- ///////////////////INIZIO RICHIAMO STRUTTURA FUNZIONE DAL CODICE EASYLANGUAGE CON ESEMPIO STRATEGIA //////////////////////
- {Input: MyPtnLY(6), MyPtnSY(4), MyPtnLN(18), MyPtnSN(19);
- Input: MyStartTrade(400), MyEndTrade(1330), MyStartPause(1200), MyEndPause(1100);
- Input: MyStop(0.011), MyProfit(0.035);
- Input: MyNoLongDay(0), MyNoShortDay(0);
- If time > MyStartTrade And time < MyEndTrade and (Time < MyStartPause or Time > MyEndPause) and PtnBaseSA(1) then Begin
- if PtnBaseSA(MyPtnLY)= True or PtnBaseSA(39) = True and PtnBaseSA(MyPtnLN) = False and Dayofweek(date) <> MyNoLongDay then Begin
- if PtnBaseSA(MyPtnSY)= True or PtnBaseSA(39) = True and PtnBaseSA(MyPtnSN) = False and Dayofweek(date) <> MyNoShortDay then Begin
- end;
- Setstopcontract;
- If MyStop > 0 then Setstoploss(MyStop);
- If MyProfit > 0 then Setprofittarget(MyProfit);}
- ///////////////////FINE RICHIAMO STRUTTURA FUNZIONE DAL CODICE EASYLANGUAGE CON ESEMPIO STRATEGIA //////////////////////
- //////////////////////////// Inizio Spiegazione di tutti i pattern base Unger ////////////////////////////
- /////// Per i range settimanali delle criptovalute alcuni pattern sono stati estesi a 7 vedi video Unger ///////
- // PtnBaseSA1 = // volatility (indecision) // yesterday body < 50% of range // No Opposite //
- // PtnBaseSA2 = // volatility (indecision) // open yesterday - close 5 days ago < 50% of (high 5 days ago - close yesterday) // No Opposite //
- // PtnBaseSA3 = // volatility (indecision) // open of 5 days ago - close of yesterday < 50% of range of last 5 days // No Opposite //
- // PtnBaseSA4 = // directional - up // high to open today so far > high to open of yesterday // Opposite 6 //
- // PtnBaseSA5 = // directional - up // high to open today so far > 1.5 * (high to open of yesterday) // Opposite 7 //
- // PtnBaseSA6 = // directional - down // open to low today so far > open to low of yesterday // Opposite 4 //
- // PtnBaseSA7 = // directional - down // open to low today so far > 1.5 * (open to low of yesterday) // Opposite 5 //
- // PtnBaseSA8 = // directional - up // 3 consecutive up closes // Opposite 9 //
- // PtnBaseSA9 = // directional - down // 3 consecutive down closes // Opposite 8 //
- // PtnBaseSA10 = // directional - up // 2 higher highs and higher lows // Opposite 11 //
- // PtnBaseSA11 = // directional - down // 2 lower highs and lower lows // Opposite 10 //
- // PtnBaseSA12 = // expansion // range of today > 0.75% of low of today // Opposite 13 //
- // PtnBaseSA13 = // compression // range of today < 0.75% of low of today // Opposite 12 //
- // PtnBaseSA14 = // directional - up // price advanced yesterday // Opposite 15 //
- // PtnBaseSA15 = // directional - down // price declined yesterday // Opposite 14 //
- // PtnBaseSA16 = // directional - up // yesterday closed below the open // Opposite 17 //
- // PtnBaseSA17 = // directional - down // yesterday closed above the open // Opposite 16 //
- // PtnBaseSA18 = // directional - down // price declined > 0.5% yesterday // Opposite 19 //
- // PtnBaseSA19 = // directional - up // price advanced > 0.5% yesterday // Opposite 18 //
- // PtnBaseSA20 = // directional - up // today has traded above yesterday's high // Opposite 22 //
- // PtnBaseSA21 = // trend - up // yesterday high was above 5-day-ago high // Opposite 23 //
- // PtnBaseSA22 = // weakness today // today has traded below yesterday's low // Opposite 20 //
- // PtnBaseSA23 = // trend - down // yesterday low was below 5-day-ago low // Opposite 21 //
- // PtnBaseSA24 = // trend - up // yesterday high was the highest in 4 days // Opposite 26 //
- // PtnBaseSA25 = // not trend up // yesterday high was lowest in 4 days // Opposite 27 //
- // PtnBaseSA26 = // trend - down // yesterday low was lowest in 4 days // Opposite 24 //
- // PtnBaseSA27 = // not trend down // yesterday low was the highest in 4 days // Opposite 25 //
- // PtnBaseSA28 = // trend - up // yesterday close was highest in 3 days and today open is higher // Opposite 29 //
- // PtnBaseSA29 = // trend - down // yesterday close was lowest in 3 days and today open is lower // Opposite 28 //
- // PtnBaseSA30 = // strength yesterday // yesterday close was in the top 20% of yesterday range // Opposite 31 //
- // PtnBaseSA31 = // weakness yesterday // yesterday close was in the bottom 20% of yesterday range // Opposite 30 //
- // PtnBaseSA32 = // movement // today open gapped either above yest. high or below yest. low //
- // PtnBaseSA33 = // big gap down // today open is at least 0.5% below yesterday close // Opposite 34 //
- // PtnBaseSA34 = // big gap up // today open is at least 0.5% above yesterday close // Opposite 33 //
- // PtnBaseSA35 = // big gap up // today open is at least 0.5% above yesterday close //
- // PtnBaseSA36 = // volatility contraction // yesterday range < 2/3 (66%) of prior 2-day avg. range // No Opposite //
- // PtnBaseSA37 = // volatility contraction // yesterday was second consecutive range contraction day // No Opposite //
- // PtnBaseSA38 = // volatility contraction // yesterday was an inside day // No Opposite //
- // PtnBaseSA39 = // volatility contraction // yesterday was not an outside day // Opposite 40 //
- //PtnBaseSA40 = // volatility expansion // yesterday was an outside day // Opposite 39 //
- //PtnBaseSA41 = // boolean // true // Opposite 42 //
- //PtnBaseSA42 = // boolean // false // Opposite 41 //
- //////////////////////////// Fine Spiegazione di tutti i pattern base Unger ////////////////////////////
- //////////////////////////// Sotto Stessi Ptn ma Livello Settimanale ////////////////////////////
- [Legacycolorvalue = true];
- input: numeropattern(Numericsimple);
- array: definizioneptn[200](false);
- var: openw0(0),openw1(0),openw2(0),openw3(0),openw4(0),openw5(0);
- var: highw0(0),highw1(0),highw2(0),highw3(0),highw4(0),highw5(0);
- var: loww0(0),loww1(0),loww2(0),loww3(0),loww4(0),loww5(0);
- var: closew0(0),closew1(0),closew2(0),closew3(0),closew4(0),closew5(0);
- // WEEKLY DATA
- openw0 = openw(0);
- openw1 = openw(1);
- openw2 = openw(2);
- openw3 = openw(3);
- openw4 = openw(4);
- openw5 = openw(5);
- highw0 = highw(0);
- highw1 = highw(1);
- highw2 = highw(2);
- highw3 = highw(3);
- highw4 = highw(4);
- highw5 = highw(5);
- loww0 = loww(0);
- loww1 = loww(1);
- loww2 = loww(2);
- loww3 = loww(3);
- loww4 = loww(4);
- loww5 = loww(5);
- closew0 = closew(0);
- closew1 = closew(1);
- closew2 = closew(2);
- closew3 = closew(3);
- closew4 = closew(4);
- closew5 = closew(5);
- // PATTERN (IDENTICI)
- definizioneptn[1] = absvalue(openw1-closew1)<0.5*(highw1-loww1) ;
- definizioneptn[2] = absvalue(openw1-closew5)<0.5*(highw5-closew1) ;
- definizioneptn[3] = absvalue(openw5-closew1)<0.5*(maxlist(highw1,highw2,highw3,highw4,highw5)-(minlist(loww1,loww2,loww3,loww4,loww5))) ;
- definizioneptn[4] = ((highw0-openw0)> ((highw1-openw1)*1)) ;
- definizioneptn[5] = ((highw0-openw0)> ((highw1-openw1)*1.5)) ;
- definizioneptn[6] = ((openw0-loww0)> ((openw1-loww1)*1)) ;
- definizioneptn[7] = ((openw0-loww0)> ((openw1-loww1)*1.5)) ;
- definizioneptn[8] = closew1>closew2 and closew2>closew3 and closew3>closew4 ;
- definizioneptn[9] = closew1<closew2 and closew2<closew3 and closew3<closew4 ;
- definizioneptn[10] = highw1>highw2 and loww1>loww2 ;
- definizioneptn[11] = highw1<highw2 and loww1<loww2 ;
- definizioneptn[12] = ((highw0>(loww0+loww0*0.75/100))) ;
- definizioneptn[13] = ((highw0<(loww0+loww0*0.75/100))) ;
- definizioneptn[14] = (closew1>closew2) ;
- definizioneptn[15] = (closew1<closew2) ;
- definizioneptn[16] = (closew1<openw1) ;
- definizioneptn[17] = (closew1>openw1) ;
- definizioneptn[18] = ((closew1<(closew2-closew2*0.5/100))) ;
- definizioneptn[19] = ((closew1>(closew2+closew2*0.5/100))) ;
- definizioneptn[20] = (highw0>(highw1)) ;
- definizioneptn[21] = (highw1>highw5) ;
- definizioneptn[22] = (loww0<loww1) ;
- definizioneptn[23] = (loww1<loww5) ;
- definizioneptn[24] = (highw1>highw2) and (highw1>highw3) and (highw1>highw4) ;
- definizioneptn[25] = (highw1<highw2) and (highw1<highw3) and (highw1<highw4) ;
- definizioneptn[26] = (loww1<loww2) and (loww1<loww3) and (loww1<loww4) ;
- definizioneptn[27] = (loww1>loww2) and (loww1>loww3) and (loww1<loww4) ;
- definizioneptn[28] = (closew1>closew2 and closew2>closew3 and openw0>closew1) ;
- definizioneptn[29] = (closew1<closew2 and closew2<closew3 and openw0<closew1) ;
- definizioneptn[30] = ((highw1-closew1)<0.20*(highw1-loww1)) ;
- definizioneptn[31] = ((closew1-loww1)<0.20*(highw1-loww1)) ;
- definizioneptn[32] = (openw0<loww1 or openw0>highw1) ;
- definizioneptn[33] = ((openw0<(closew1-closew1*0.5/100))) ;
- definizioneptn[34] = ((openw0>(closew1+closew1*0.5/100))) ;
- definizioneptn[35] = (highw0<highw1 and loww0>loww1) ;
- definizioneptn[36] = (highw1-loww1)<((highw2-loww2)+(highw3-loww3))/3 ;
- definizioneptn[37] = (highw1-loww1)<(highw2-loww2) and (highw2-loww2)<(highw3-loww3) ;
- definizioneptn[38] = (highw2>highw1 and loww2<loww1) ;
- definizioneptn[39] = (highw1<highw2 or loww1>loww2) ;
- definizioneptn[40] = (highw2<highw1 and loww2>loww1) ;
- definizioneptn[41] = true ;
- definizioneptn[42] = false ;
- PtnBaseSA = definizioneptn[numeropattern];
Advertisement