Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Problem with Tick Replay

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Problem with Tick Replay

    Hello,

    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.

    #2
    Hello JoseFRS,

    Unfortunately, NinjaScript Strategies do not have the ability to be automatically enabled.

    If the connection is going to be disconnected, the strategy will be disabled and will need to be manually re-enabled.

    If you need something to automatically start placing orders, you would need to use the Addon approach instead of a Strategy.




    An indicator that uses the addon approach named can be found here.

    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rhyminkevin, Today, 04:58 PM
    1 response
    41 views
    0 likes
    Last Post Anfedport  
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    7 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    49 views
    0 likes
    Last Post futtrader  
    Working...
    X