I try to create an indicator showing the difference in time between two bars.
Using the NinjaScript editor /New Indicator,
I only create two plots:
the Cero line ( named as "Cero" ), and Volatility bars ( named "Volat")
The only code that I write in the OnBarUpdate() is this:
protected override void OnBarUpdate()
{
if(CurrentBars[0] < 1 )
return;
Cero[0]=0;
Volat[0]= ToTime(Time[0])- ToTime(Time[1]);
}
And when I compile, there is a message of "Unhandled Exception.....
And then NinjaTrader8 is closed.
¿Where is the mistake??
¿How to get the time difference between two bars correctly??
Thanks.
Comment