I've been struggling with this problem for months and every time I seem to find a possible solution a new problem arises. And I'm already pretty desperate.
The initial idea is very simple. I need my strategy to continue running after a weekend automatically. Without the need for human intervention.
As you may well know, if a Disconnected occurs during the weekend, the strategies are closed and not reopened.
I have already assumed that nothing can be done against it and that I will have to be careful to activate them manually, but I want that, simply activating them on Sunday before the market returns to operate will be enough. And I can't.
1.- I have already studied all the possible strategy start behaviors, and I have set it to Keep Running.
2.- I have already prepared my strategy so that after startup, it processes the historical data correctly so that the positions of the strategy coincide with the positions of the account.
3.- Given that my strategy acts on OnOpenBar (OnEachTick and only when IsFirstTickOfBar=true) and that the historical data processing acts only OnCloseBar, I was afraid that the calculation made with the historical data would not coincide with what actually happened in real time and that the strategy would not end up positioned the same as the account after said historical data processing, which would end up closing the possible open positions and it would be a disaster for my strategy.
4.- Against the previous problem, you advised me to add a second series with AddDataSeries(Data.BarsPeriodType.Tick, 1) so that, during the processing of historical data after the start of the strategy, all the openings and closings of positions were made against said series.
5.- For the above to work, you told me that I had to enable Tick Replay.
After all this, I tested disconnections in real time. That is, after my strategy opens positions and while they are open, I make a disconnection, which deactivates the strategy. After that, I reconnect and activate the strategy manually. Despite the delay of the Tick Replay, everything seems to work correctly. Now yes, the strategy remains open and its positions coincide with that of the account, so the positions are not automatically closed by Ninja. All OK.
But nevertheless, when I have put it to work in real and during the weekend there is a disconnection and on Sunday I manually reconnect and activate the strategy, incomprehensibly, the bars stop evolving. That is, the graph only shows market data until Friday, but all the data and bars from the new market opening on Sunday night are no longer obtained. In short, the strategy does not receive any more market data from that moment on.
I really don't know what I'm doing wrong or what else to do.
I beg you please for real help with this.
I have been contacting you for months and each of the previous steps has been costly and laborious to obtain.
I beg you please help me with this because I have been working for a year and a half developing a strategy and everything is stopped by these cuts on weekends.
I trust you can help me.
I await your response.
All the best.
Comment