I have a relatively simple indicator that occasionally 'stutters' and stops painting bars.
If I hit F5, the chat refreshes and everything looks good....until the next stutter.
Everything else on the chart moves on per normal, but this indicator just occasionally stops painting bars.
What did I do wrong????
Code excerpt:
protected override void Initialize()
{
Add(new Plot(new Pen(Color.Red, 6), PlotStyle.Bar, "AO (Negative)"));
Add(new Plot(new Pen(Color.Green, 6), PlotStyle.Bar, "AO (Positive)"));
Add(new Plot(Color.Transparent, PlotStyle.Line, "AO"));
DrawOnPricePanel = false;
CalculateOnBarClose = false;
Overlay = false;
PriceTypeSupported = false;
fastline = new DataSeries(this);
slowline = new DataSeries(this);
}
//==============================================
protected override void OnBarUpdate()
{
if(CurrentBar == 0)
{
DrawHorizontalLine("Zero Line", true, 0, Color.DimGray, DashStyle.Solid, 1);
------ other code -------
}
ao = fastline[0]-slowline[0];
if(ao>ao1)
AOPos.Set(ao);
else
AONeg.Set(ao);
{
if(FirstTickOfBar)
ao1=ao;
}
AOValue.Set(ao);
}
Comment