Nessuno è mai al sicuro

Picchio prova questo, ma fai dei controlli che non ho verificato.....:D
Dove il plot del trailing diventa verde è quando si attiva......

var:ma,mi,valtrailing,miovt,coloretr,coloretrprec,colorenow,valactive,trailon;
valtrailing=0.8;
valactive=1.6;
//Sezione di ingresso
if t = 900 and c > o then
enterlong(nextbar,atopen);
ma=h;
endif;
if t = 900 and c < o then
entershort(nextbar,atopen);
mi=l;
endif;

//controllo nuovi minimi/massimi
if positiondir = 1 then
if h[1] > ma then
ma=h[1];
endif;
endif;
if positiondir = -1 then
if l[1] < mi then
mi=l[1];
endif;
endif;
if positiondir =1 and h > positionvalue+(positionvalue*valactive/100) and trailon = 0 then
trailon=1;
endif;
if positiondir =-1 and l < positionvalue-(positionvalue*valactive/100) and trailon=0 then
trailon=-1;
endif;


//controllo rottura livello trailing
if c <= ma-(ma*valtrailing/100) and positiondir = 1 and trailon = 1 then
exitlong(bar,atclose);
endif;
if c > mi+(mi*valtrailing/100) and positiondir = -1 and trailon= -1 then
exitshort(bar,atclose);
endif;
if positiondir = 0 then
trailon=0;
endif;

//sezione di uscita
if t=1725 then
exitlong(nextbar,atopen);
exitshort(nextbar,atopen);
endif;

//PLOT TRAILING
if valtrailing <> 0 then
if PositionDir = 1 then
miovt = ma-(ma*valtrailing/100);
if trailon <>0 then
coloreTr = green;
endif;
if trailon = 0 then
coloreTr = red;
endif;
elseif PositionDir = -1 then
miovt = mi+(mi*valtrailing/100);
if trailon <> 0 then
coloreTr = green;
endif;
if trailon = 0 then
coloreTr = red;
endif;
else
coloreTr = white;
endif;
else
miovt = miovt;
coloreTr = fuchsia;
endif;
if coloreTrPrec = white then
colorenow = coloreTrPrec;
else
colorenow = coloreTr;
endif;
plotchart(miovt, 0, colorenow, solid, 2);
coloreTrPrec = coloreTr;
 
Picchio prova questo, ma fai dei controlli che non ho verificato.....:D
Dove il plot del trailing diventa verde è quando si attiva......

var:ma,mi,valtrailing,miovt,coloretr,coloretrprec,colorenow,valactive,trailon;
valtrailing=0.8;
valactive=1.6;
//Sezione di ingresso
if t = 900 and c > o then
enterlong(nextbar,atopen);
ma=h;
endif;
if t = 900 and c < o then
entershort(nextbar,atopen);
mi=l;
endif;

//controllo nuovi minimi/massimi
if positiondir = 1 then
if h[1] > ma then
ma=h[1];
endif;
endif;
if positiondir = -1 then
if l[1] < mi then
mi=l[1];
endif;
endif;
if positiondir =1 and h > positionvalue+(positionvalue*valactive/100) and trailon = 0 then
trailon=1;
endif;
if positiondir =-1 and l < positionvalue-(positionvalue*valactive/100) and trailon=0 then
trailon=-1;
endif;


//controllo rottura livello trailing
if c <= ma-(ma*valtrailing/100) and positiondir = 1 and trailon = 1 then
exitlong(bar,atclose);
endif;
if c > mi+(mi*valtrailing/100) and positiondir = -1 and trailon= -1 then
exitshort(bar,atclose);
endif;
if positiondir = 0 then
trailon=0;
endif;

//sezione di uscita
if t=1725 then
exitlong(nextbar,atopen);
exitshort(nextbar,atopen);
endif;

//PLOT TRAILING
if valtrailing <> 0 then
if PositionDir = 1 then
miovt = ma-(ma*valtrailing/100);
if trailon <>0 then
coloreTr = green;
endif;
if trailon = 0 then
coloreTr = red;
endif;
elseif PositionDir = -1 then
miovt = mi+(mi*valtrailing/100);
if trailon <> 0 then
coloreTr = green;
endif;
if trailon = 0 then
coloreTr = red;
endif;
else
coloreTr = white;
endif;
else
miovt = miovt;
coloreTr = fuchsia;
endif;
if coloreTrPrec = white then
colorenow = coloreTrPrec;
else
colorenow = coloreTr;
endif;
plotchart(miovt, 0, colorenow, solid, 2);
coloreTrPrec = coloreTr;




Ok


messo in rt


controllo


Grazie :V:V
 
Che le uscite in rt a back test coincidano sempre te lo garantisco io......:D
Controlla se fa bene i conti più altro......


ci siamo per l'uscita , anche se a dire il vero lui è uscito a 18035 ,mentre lo 0,50 dal massimo è 18045


ora pero' l'ideale , per far si di essere sicuri che il ts non vede il futuro sarebbe che il fib tornasse sopra 18035


e vedere come si comporta
 

Allegati

  • Foto104.png
    Foto104.png
    30,3 KB · Visite: 180
ci siamo per l'uscita , anche se a dire il vero lui è uscito a 18035 ,mentre lo 0,50 dal massimo è 18045


ora pero' l'ideale , per far si di essere sicuri che il ts non vede il futuro sarebbe che il fib tornasse sopra 18035


e vedere come si comporta


Verifica ma al futuro non ci guarda....:D
Eh ma lui esce in close di barra, la % non sarà mai giusta.....
 
si

ma questo è il minimo:up:


l'importante è che non faccia saprire l'uscita (come fa adesso il tp di vt) se dovesse risalire

:up:

Questo codice è una parte del mio ts sul FIB e anche altri, usati da molto tempo e per tutte le operazioni io segno sempre ingressi e uscite a mercato, da ts in rt e da ts in back test......vai tranquillo che questo non bara, se non cambiano le barre....:D
 

Users who are viewing this thread

Back
Alto