Nessuno è mai al sicuro

:D




:D


lo sapete , sono una crapa a programmare:D



Cmq voi due avete ancora un compitino da svolgere

il ts orario sul break della candela a 90 minuti con opzione range ristretto range ampio

ricordate?:maestro:

Ti sembrerà strano... ma mentre scrivo due minc***** qua dentro, mi tocca pure lavorare .... :sad::sbava:
 
Ecco qui, questo è un codice che gestisce manualmente il traling in close di barra e che non genera mai problemi tra back test e realtime.

Omaggio anche il codice che lo plotta......:D Vado a magà......

var:ma,mi,valtrailing,miovt,coloretr,coloretrprec,colorenow;
valtrailing=0.8;
//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;
//controllo rottura livello trailing
if c <= ma-(ma*valtrailing/100) and positiondir = 1 then
exitlong(bar,atclose);
endif;
if c > mi+(mi*valtrailing/100) and positiondir = -1 then
exitshort(bar,atclose);
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 miovt >= positionvalue then
coloreTr = green;
endif;
if miovt < positionvalue then
coloreTr = red;
endif;
elseif PositionDir = -1 then
miovt = mi+(mi*valtrailing/100);
if miovt <=positionvalue then
coloreTr = green;
endif;
if miovt >positionvalue 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;
 
Ecco qui, questo è un codice che gestisce manualmente il traling in close di barra e che non genera mai problemi tra back test e realtime.

Omaggio anche il codice che lo plotta......:D Vado a magà......

var:ma,mi,valtrailing,miovt,coloretr,coloretrprec,colorenow;
valtrailing=0.8;
//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;
//controllo rottura livello trailing
if c <= ma-(ma*valtrailing/100) and positiondir = 1 then
exitlong(bar,atclose);
endif;
if c > mi+(mi*valtrailing/100) and positiondir = -1 then
exitshort(bar,atclose);
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 miovt >= positionvalue then
coloreTr = green;
endif;
if miovt < positionvalue then
coloreTr = red;
endif;
elseif PositionDir = -1 then
miovt = mi+(mi*valtrailing/100);
if miovt <=positionvalue then
coloreTr = green;
endif;
if miovt >positionvalue 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;



Grazie mille:clapclap::band::bow:
 

Users who are viewing this thread

Back
Alto