I have this problem. I added those New Calculation as you can see in the code sample. They are all private doubles. AddPlot(Brushes.Yellow, "candle"); only display one yellow dot on the chart and candle wont return right answer.
protected override void OnBarUpdate()
{
if(visible)
{
Draw.HorizontalLine(this, "tag3", azure, azure141);
}
else{
}
if(visibleY) {
Draw.HorizontalLine(this, "tag4", jaune, Yellow161);
}
else {}
[U][I][B]// New calculation[/B][/I][/U]
if(CurrentBar < 195) return;
double closePrice16 = Bars.GetClose(194);
double closePrice9 = Bars.GetClose(195);
double difCP = closePrice16 - closePrice9;
double candle = Close[0] + difCP + difCP00;
if(CurrentBar < 389) return;
double closePrice159 = Bars.GetClose(389);
double closePrice89 = Bars.GetClose(390);
difCP00 = closePrice159 - closePrice89;
Value[0] = candle;
}
TY


Comment