I have a simple Indicator that must calculate current Ask Price from two instruments (f.e. GC and CL).
My code is:
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
if(marketDataUpdate.MarketDataType == MarketDataType.Last)
{
curAsk = GetCurrentAsk(0);
nextAsk = GetCurrentAsk(0);
}
}
In OnBarUpdate method I have only:
Print("Cur Ask" + curAsk);
Print("Next Ask" + nextAsk);
When I'm trying to apply this indicator on the chart i have an error
How to fix this? Thank you!

Comment