Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // PtnBaseSaCriptovalute //
- ///////////////////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 //
- [Legacycolorvalue = true];
- input: numeropattern(Numericsimple);
- array: definizioneptn[200](false);
- var:opend0(0),opend1(0),opend2(0),opend3(0),opend4(0),opend5(0),opend6(0),opend7(0);
- var:highd0(0),highd1(0),highd2(0),highd3(0),highd4(0),highd5(0),highd6(0),highd7(0);
- var:lowd0(0),lowd1(0),lowd2(0),lowd3(0),lowd4(0),lowd5(0),lowd6(0),lowd7(0);
- var:closed0(0),closed1(0),closed2(0),closed3(0),closed4(0),closed5(0),closed6(0),closed7(0);
- // Valori in parentesi Session: (1=regular session, 0=all sessions), (Number of session ago to reference price (0 = current session).
- opend0 = openD(0); //(0,0); "opens day no session"
- opend1 = openD(1); //(0,1); "opens day no session"
- opend2 = openD(2); //(0,2); "opens day no session"
- opend3 = openD(3); //(0,3); "opens day no session"
- opend4 = openD(4); //(0,4); "opens day no session"
- opend5 = openD(5); //(0,5); "opens day no session"
- opend6 = openD(6); //(0,6); "opens day no session"
- opend7 = openD(7); //(0,7); "opens day no session"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- highd0 = highD(0); //(0,0); "highs day no session"
- highd1 = highD(1); //(0,1); "highs day no session"
- highd2 = highD(2); //(0,2); "highs day no session"
- highd3 = highD(3); //(0,3); "highs day no session"
- highd4 = highD(4); //(0,4); "highs day no session"
- highd5 = highD(5); //(0,5); "highs day no session"
- highd6 = highD(6); //(0,6); "highs day no session"
- highd7 = highD(7); //(0,7); "highs day no session"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- lowd0 = lowD(0); //(0,0); "lows day no session"
- lowd1 = lowD(1); //(0,1); "lows day no session"
- lowd2 = lowD(2); //(0,2); "lows day no session"
- lowd3 = lowD(3); //(0,3); "lows day no session"
- lowd4 = lowD(4); //(0,4); "lows day no session"
- lowd5 = lowD(5); //(0,5); "lows day no session"
- lowd6 = lowD(6); //(0,6); "lows day no session"
- lowd7 = lowD(7); //(0,7); "lows day no session"
- // "CONTINUA FINO A 5 "SETTIMANA BORSISTICA" 7 PER CRIPTOVALUTE"
- closed0 = closeD(0); //(0,0); "closes day no session"
- closed1 = closeD(1); //(0,1); "closes day no session"
- closed2 = closeD(2); //(0,2); "closes day no session"
- closed3 = closeD(3); //(0,3); "closes day no session"
- closed4 = closeD(4); //(0,4); "closes day no session"
- closed5 = closeD(5); //(0,5); "closes day no session"
- closed6 = closeD(6); //(0,6); "closes day no session"
- closed7 = closeD(7); //(0,7); "closes day no session"
- // "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] = absvalue(opend7-closed1)<0.5*(maxlist(highd1,highd2,highd3,highd4,highd5,highd6,highd7)-(minlist(lowd1,lowd2,lowd3,lowd4,lowd5,lowd6,lowd7))) ;
- definizioneptn[42] = (highd1>highd7) ;
- definizioneptn[43] = (lowd1<lowd7) ;
- definizioneptn[44] = true ;
- definizioneptn[45] = false ;
- PtnBaseSaCrypto = 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 PtnBaseSACrypto(MyPtnLY)= True or PtnBaseSACrypto(39) = True and PtnBaseSACrypto(MyPtnLN) = False and Dayofweek(date) <> MyNoLongDay then Begin
- if PtnBaseSACrypto(MyPtnSY)= True or PtnBaseSACrypto(39) = True and PtnBaseSACrypto(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 //
- // 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 = // volatility (indecision) // open of 7 days ago - close of yesterday < 50% of range of last 7 days // No Opposite //
- //PtnBaseSA42 = // trend - up // yesterday high was above 7-day-ago high // Opposite 43 //
- //PtnBaseSA43 = // trend - down // yesterday low was below 7-day-ago low // Opposite 42 //
- // PtnBaseSA44 = true // boolean // true // Opposite 45 //
- // PtnBaseSA45 = false // boolean // false // Opposite 44 //
- //////////////////////////// Fine Spiegazione di tutti i pattern base Unger ////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement