I am trying to fetch snapshot data from an instrument which I create in code by invoking:
SPXInstrument = NinjaTrader.Cbi.Instrument.GetInstrument("^SP500") ;
I then am able to use the instrument, albeit the MarketData does only refresh if I add it to e,g. a Market Analyzer (until then all Market Data is null.)
Once the instrument starts getting its Market Data refreshed, I am able to access most pricepoints in the Market Data object, but MarketData.Opening is always null. I am attaching a screenshot.
Could you please help me understand how:
1) I can refresh the MarketData object without using a workaround such as the Market Analyzer
2) how do I get the opening price of the day from the MarketData Object?
Many thanks,
Libor
Comment