double highestHigh = High[HighestBar(High,Length)];
double lowestLow = Low[LowestBar(Low,Length)];
double smaATR = SMA(ATR(Period),Period)[0];
double upperVol = highestHigh - (Factor*smaATR);
double lowerVol = lowestLow + (Factor*smaATR);
if(Close[0] > upperVol && Close[0] > lowerVol)
{
BarBrush = upBrush;
upsignal = 1 ;
}
else
{
BarBrush = dnBrush;
downsignal = 2;
Print(CurrentBar);
}

Comment