protected override void OnBarUpdate()
{
if (CurrentBar < 30) return;
else
{
Print(string.Format("{0} : {1}", Time[0], High[0]));
double span= ((High[0]==Low[0])? 0.001: High[0]-Low[0]);
Print(string.Format("{0} : {1} } ", Time[0],span.ToString("N4") ));
spanline[0]=span;
Print(string.Format("{0} : {1} : {2}: {3} } ", Time[0], High[0].ToString("N4"), Low[0].ToString("N4"),spanline[0].ToString("N4") ));
}
}
Print Results:
10/9/2023 6:07:45 PM : 4367.5
Indicator 'XX: Error on calling 'OnBarUpdate' method on bar 30: Input string was not in a correct format.
I added this indicator to ES chart in playback mode with 10/13 15 second data, I do not understand two issues:
1) why the first print out come with 10/9 datestamp while I was using 10/13 ES data ( If I add other indicators , they will print out correct 10/13 datestamp for my other indicator)
2) Is there anything wrong with span definition, what I want to achieve is non-zero difference between high and low
Anyone can help?

Comment