Salve, sono nuovo del forum,volevo chiedervi se potete postare il ts del supertrend da applicare a visualtrader visto che non lo ha di default.Grazie in anticipo.
Credo sia il 1949: una conferma può venire da Solospread.
Ti posto qui il 1949, che puoi ritrovare anche nel tread con lo stesso numero.
// TS: CICLONE_SOLOSPREAD_ROBOM_1949
Var: miavar(0), Miacondizione1,Miacondizione2,miacondizione3,Miacondizione4,Miacondizione5,Miacondizione6;
Var: Miacondizione7,Miacondizione8, Miacondizione9,Miacondizione10, Miacondizione11,Miacondizione12, Miacondizione13,Miacondizione14;
Var: Miacondizione15,Miacondizione16,Miacondizione17,miacondizione18,STOP;
Var: Semaforo0910(0), semaforo1010(0), semaforo1110(0), Semaforo1210(0), semaforo1310(0), semaforo1410(0),Semaforo1510(0), semaforo1610(0), semaforo1710(0);
Var: ultimaposizione(0), indzona1(0), valoreritracciamento(0), valore(0), ultimoprezzo(0), barra(0), ope1(0), min1(0), max1(0), clo1(0), ritracciamentocalcolato(0);
Var: miavel, mio10, vettorestop(0), pippo(0), vettoreposizione(0),e,MioHight,MioLow,valorerientro;
//installtrailingprofit (inperc,0.8,0.1,trailing);
InstalltakeProfit(INPERC, 0.75, "take");
MioHight = HHV(REF(H,4),1);
MioLow = LLV(REF(L,4),1);
//************************************************** ************************************************** ************
if T = 0910 then Miacondizione1 = C+20; Miacondizione2 = C-20; endif;
if T = 1010 then Miacondizione3 = C+20; Miacondizione4 = C-20; endif;
if T = 1110 then Miacondizione5 = C+20; Miacondizione6 = C-20; endif;
if T = 1210 then Miacondizione7 = C+20; Miacondizione8 = C-20; endif;
if T = 1310 then Miacondizione9 = C+20; Miacondizione10= C-20; endif;
if T = 1410 then Miacondizione11= C+20; Miacondizione12= C-20; endif;
if T = 1510 then Miacondizione13 =C+20; Miacondizione14= C-20; endif;
if T = 1610 then Miacondizione15 =C+20; Miacondizione16= C-20; endif;
if T = 1710 then Miacondizione17 =C+20; Miacondizione18= C-20; endif;
//************************************************** ************************************************** *********************
//Non si riesce a capire perche ma se metto il controllo in T = non lo prende, probabilmente perche delle barre potrebbero mancare
//in assenza di contrattazione
if T >=0910 and T <= 1009 then if positiondir = 1 then semaforo0910 = 1; endif; if positiondir = - 1 then semaforo0910 = - 1; endif; endif;
if T >=1010 and T <= 1109 then if positiondir = 1 then semaforo1010 = 1; endif; if positiondir = - 1 then semaforo1010 = - 1; endif; endif;
if T >=1110 and T <= 1209 then if positiondir = 1 then semaforo1110 = 1; endif; if positiondir = - 1 then semaforo1110 = - 1; endif; endif;
if T >=1210 and T <= 1309 then if positiondir = 1 then semaforo1210 = 1; endif; if positiondir = - 1 then semaforo1210 = - 1; endif; endif;
if T >=1310 and T <= 1409 then if positiondir = 1 then semaforo1310 = 1; endif; if positiondir = - 1 then semaforo1310 = - 1; endif; endif;
if T >=1410 and T <= 1509 then if positiondir = 1 then semaforo1410 = 1; endif; if positiondir = - 1 then semaforo1410 = - 1; endif; endif;
if T >=1510 and T <= 1609 then if positiondir = 1 then semaforo1510 = 1; endif; if positiondir = - 1 then semaforo1510 = - 1; endif; endif;
if T >=1610 and T <= 1709 then if positiondir = 1 then semaforo1610 = 1; endif; if positiondir = - 1 then semaforo1610 = - 1; endif; endif;
if T >=1710 and T <= 1730 then if positiondir = 1 then semaforo1710 = 1; endif; if positiondir = - 1 then semaforo1710 = - 1; endif; endif;
//************************************************** ************************************************** ***************************************
//Identifica il livello del ritracciamento
//Con vettoreposizione mi salvo la posizione del sistema in ogni barra
//Se la posizione attuale è flat e la precedente era long e lastopisstop = true vuole dire (fino a quando non attiviamo lo stoploss che
//è uscito in trailing
vettoreposizione = positiondir;
if vettoreposizione = 0 and vettoreposizione[1] = 1 and LastopIsStop = true then valoreritracciamento = valexit;
if (CompareTime(09, 10, 0) > 0) and (CompareTime(10,09, 0) < 0) then Miacondizione1 = valexit + 10; semaforo0910 = 0; endif;
if (CompareTime(10, 10, 0) > 0) and (CompareTime(11,09, 0) < 0) then Miacondizione3 = valexit + 10; semaforo1010 = 0; endif;
if (CompareTime(11, 10, 0) > 0) and (CompareTime(12,09, 0) < 0) then Miacondizione5 = valexit + 10; semaforo1110 = 0; endif;
if (CompareTime(12, 10, 0) > 0) and (CompareTime(13,09, 0) < 0) then Miacondizione7 = valexit + 10; semaforo1210 = 0; endif;
if (CompareTime(13, 10, 0) > 0) and (CompareTime(14,09, 0) < 0) then Miacondizione9 = valexit + 10; semaforo1310 = 0; endif;
if (CompareTime(14, 10, 0) > 0) and (CompareTime(15,09, 0) < 0) then Miacondizione11= valexit + 10; semaforo1410 = 0; endif;
if (CompareTime(15, 10, 0) > 0) and (CompareTime(16,09, 0) < 0) then Miacondizione13= valexit + 10; semaforo1510 = 0; endif;
if (CompareTime(16, 10, 0) > 0) and (CompareTime(17,09, 0) < 0) then Miacondizione15= valexit + 10; semaforo1610 = 0; endif;
if (CompareTime(17, 10, 0) > 0) and (CompareTime(17,30, 0) < 0) then Miacondizione17= valexit + 10; semaforo1710 = 0; endif;
endif;
if vettoreposizione = 0 and vettoreposizione[1] = -1 and LastopIsStop = true then valoreritracciamento = valexit;
if (CompareTime(09, 10, 0) > 0) and (CompareTime(10,09, 0) < 0) then Miacondizione2 = valexit - 10; semaforo0910 = 0; endif;
if (CompareTime(10, 10, 0) > 0) and (CompareTime(11,09, 0) < 0) then Miacondizione4 = valexit - 10; semaforo1010 = 0; endif;
if (CompareTime(11, 10, 0) > 0) and (CompareTime(12,09, 0) < 0) then Miacondizione6 = valexit - 10; semaforo1110 = 0; endif;
if (CompareTime(12, 10, 0) > 0) and (CompareTime(13,09, 0) < 0) then Miacondizione8 = valexit - 10; semaforo1210 = 0; endif;
if (CompareTime(13, 10, 0) > 0) and (CompareTime(14,09, 0) < 0) then Miacondizione10= valexit - 10; semaforo1310 = 0; endif;
if (CompareTime(14, 10, 0) > 0) and (CompareTime(15,09, 0) < 0) then Miacondizione12= valexit - 10; semaforo1410 = 0; endif;
if (CompareTime(15, 10, 0) > 0) and (CompareTime(16,09, 0) < 0) then Miacondizione14= valexit - 10; semaforo1510 = 0; endif;
if (CompareTime(16, 10, 0) > 0) and (CompareTime(17,09, 0) < 0) then Miacondizione16= valexit - 10; semaforo1610 = 0; endif;
if (CompareTime(17, 10, 0) > 0) and (CompareTime(17,30, 0) < 0) then Miacondizione18= valexit - 10; semaforo1710 = 0; endif;
endif;
//************************************************** ************************************************** **********************************************
if (CompareTime(09, 10, 0) > 0) and (CompareTime(10,09, 0) < 0) then
if C > Miacondizione1 and semaforo0910 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo0910 = 1; endif;
if C < Miacondizione2 and semaforo0910 <> -1 and C < MioHight and C < C[1]then EnterShort(NextBar,AtOpen); semaforo0910 = -1; endif;
endif;
if (CompareTime(10, 10, 0) > 0) and(CompareTime(11,09, 0) < 0) then
if C > Miacondizione3 and semaforo1010 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1010 = 1; endif;
if C < Miacondizione4 and semaforo1010 <> -1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1010 = -1; endif;
endif;
if (CompareTime(11, 10, 0) > 0) and (CompareTime(12,09, 0) < 0) then
if C > Miacondizione5 and semaforo1110 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1110 = 1; endif;
if C < Miacondizione6 and semaforo1110 <> -1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1110 = -1; endif;
endif;
if (CompareTime(12, 10, 0) > 0) and (CompareTime(13,09, 0) < 0) then
if C > Miacondizione7 and semaforo1210 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1210 = 1; endif;
if C < Miacondizione8 and semaforo1210 <> -1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1210 = -1; endif;
endif;
if (CompareTime(13, 10, 0) > 0) and (CompareTime(14,09, 0) < 0) then
if C > Miacondizione9 and semaforo1310 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1310 = 1; endif;
if C < Miacondizione10 and semaforo1310 <>-1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1310 = -1;endif;
endif;
if (CompareTime(14, 10, 0) > 0) and (CompareTime(15,09, 0) < 0) then
if C > Miacondizione11 and semaforo1410 <> 1 and C > MioHight and C > C[1]then EnterLong(NextBar, AtOpen); semaforo1410 = 1; endif;
if C < Miacondizione12 and semaforo1410 <>-1 and C < MioHight and C < C[1]then EnterShort(NextBar,AtOpen); semaforo1410 = -1;endif;
endif;
if (CompareTime(15, 10, 0) > 0) and (CompareTime(16,09, 0) < 0) then
if C > Miacondizione13 and semaforo1510 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1510 = 1; endif;
if C < Miacondizione14 and semaforo1510 <>-1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1510 = -1; endif;
endif;
if (CompareTime(16, 10, 0) > 0) and (CompareTime(17,09, 0) < 0) then
if C > Miacondizione15 and semaforo1610 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1610 = 1; endif;
if C < Miacondizione16 and semaforo1610 <>-1 and C < MioHight and C < C[1] then EnterShort(NextBar,AtOpen); semaforo1610 = -1; endif;
endif;
if (CompareTime(17, 10, 0) > 0) and (CompareTime(17,30, 0) < 0) then
if C > Miacondizione17 and semaforo1710 <> 1 and C > MioHight and C > C[1] then EnterLong(NextBar, AtOpen); semaforo1710 = 1; endif;
if C < Miacondizione18 and semaforo1710 <>-1 and C < MioHight and C < C[1] then EnterShort(NextBar, AtOpen);semaforo1710 = -1; endif;
endif;
//************************************************** ************************************************** *if t>=1732 then
if t>=1732 then
if positiondir=1 then
exitlong(bar,atclose);
endif;
if positiondir=-1 then
exitshort(bar,atclose);
endif;
endif;
if T >=0910 and T <= 1730 and vettoreposizione[1] = 1 and LastopIsStop = true then valorerientro = valexit-10; endif;
if T >=0910 and T <= 1730 and vettoreposizione[1] = -1 and LastopIsStop = true then valorerientro = valexit+10; endif;
PlotChart(valoreritracciamento,0,red,solid,2);
plotChart(valorerientro,0,green,solid,2);