Standard(NT8): The ATR paintbar program paints the price bars "green" when price is above a particular volatility function value, and "red" when price is below a particular volatility function value. WHEN THE PRICE IS BETWEEN THOSE VOLATILITY BANDS, the regular program will just paint the bars whatever color you have as default. I set it to white for the example below.
NT8 Indicator Logic:
protected override void OnBarUpdate()
{
if(CurrentBar < Length) return;
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 = Upcolor;
}
BarBrush = BarBrush;
if(Close[0] < lowerVol && Close[0] < upperVol)
{
BarBrush = Downcolor;
}
My Modification: I set the paint bars to persist on painting the last color applied to the plot UNTIL the other color value is triggered by the volatility function. So the bars will stay green until red is triggered and never revert to the default chart color.
I cannot figure out how to do this in NT8. Can anyone help me? The above modification is done in Tradestation.
Comment