if (Trend_flo == 1)
{
if ((Open[0] <= TrStop[0]) | (High[0] <= TrStop[0]) | (Low[0] <= TrStop[0]) | (Close[0] <= TrStop[0]))
{
Trend_flo =0;
BarColor = Color.Magenta;
//Print("End of Trend_flo Long: "+ Trend_flo);
Print("TrStop: Barnumber "+ CurrentBar+" is "+TrStop[0]+" Trendflo is "+Trend_flo);
}
else
{
if (LastBar < CurrentBar)
{
if (Close[0] > Close[1]) TrStop.Set(Low[0] - StDev * 1.382);
if (Low[0] - High[1] > StDev) TrStop.Set(Low[0] - StDev * 0.618);
if (TrStop[0] < TrStop[1]) TrStop.Set(TrStop[1]);
if (TrStop[0] == 0) TrStop.Set(Close[0]);
DrawDot("", true, 0, TrStop[0], Color.Orange);
BarColor = Color.Blue;
Print("TrStop: Barnumber "+ CurrentBar+" is "+TrStop[0]+" Trendflo is "+Trend_flo);
}
}
}
At Bar 22 Trendflo==1 and from BAr 23 -38 the code in orange is working correctly but at Bar Number 39 the current Low is less than Trstop '(Low[0] <= TrStop[0])' yet Trend_flo is not RESET (=0??
This is weird?
Comment