I'm running into an issue where some code I've been working on to display volumetric data is throwing up instance of an object errors in Market Replay. It's strange because the code seems to work just fine in a live trading environment, but not on a recorded one.
Here's the specific code that's causing the problem:
protected override void OnBarUpdate() { if (Bars == null) return; // For our volumetric bars NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType; Print("=========================================== =============================="); Print("Bar: " + CurrentBar); [B]Print("Trades: " + barsType.Volumes[CurrentBar].Trades); Print("Total Volume: " + barsType.Volumes[CurrentBar].TotalVolume);[/B] Print("=========================================== =============================="); }
I know it's probably something basic, but I'd rather check here than banging my head against the wall for another half hour.
Thanks in advance for any advice or guidance! Feel free to send me off to a related URL to learn more if that's easier.
Comment