I am using the add-on framework sample addon as basis for my custom addon.
I am trying to figure out how to subscribe to real time data updates with a custom frequency - specifically, I want the OnBarUpdate() function to be triggered every minute.
I have modified the code and it does return 1-minute bars when called, but the real-time updates are still happening every tick in the OnBarUpdate method.
I fetch the bars as folliows:
barsRequest = new NinjaTrader.Data.BarsRequest(instrument, 10);
barsRequest.BarsPeriod = new NinjaTrader.Data.BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 1 };
barsRequest.TradingHours = NinjaTrader.Data.TradingHours.Get("Default 24 x 7");
And I subscribe to real time data like so:
if (subscribeRealTimeData)
{
barsRequest.Update += OnBarUpdate;
}
Is the frequency of bars updates not customizable, or am I doing something wrong?
Thank you very much for any help!
Best,
Libor
Comment