100pezzi
Nuovo forumer
Indicator: @ndyTrend Indicator
Codice:
[COLOR=Navy]input: Vola1 (2.2), Vola2(21);[/COLOR] [COLOR=Navy]
Var: HClose(-99999), LClose(99999), Var1(0), Var2, TRAILINGSTOP;
Var1 = Op(constval(Vola1), stddev(C, Vola2), Mul);[/COLOR] [COLOR=Navy]
HClose = IIF(C > HClose, C, HClose);
LClose = IIF(C < LClose, C, LClose);
If (Var2 = 0) and (CurrentBar <= 1) then[/COLOR] [COLOR=Navy]
Var2 = HClose - Var1;
endif;
If (C < Var2) then[/COLOR] [COLOR=Navy]
Var2 = LClose + Var1;
HClose = C;
Endif;
If (C > Var2) then[/COLOR] [COLOR=Navy]
Var2 = HClose - Var1;
LClose = C;
Endif;[/COLOR][COLOR=Navy]
If (CurrentBar > 1) Then[/COLOR] [COLOR=Navy]
TRAILINGSTOP = Var2[1];
endif;[/COLOR][COLOR=Navy]
PlotChart(TRAILINGSTOP, 0, lime, solid, 2);[/COLOR]