• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Logic Disconnection / Market Close Questions

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

    Strategy Logic Disconnection / Market Close Questions

    I'm trading at Ninjatrader Brokerage and notice that my strategy disconnects after the market closes which i suspect is normal. Can someone point me to some documentation of what happens to the strategy logic in memory when this happens.

    Given the following scenario.

    The plan is to go long on the ES Futures Friday and carry this until Tuesday where I sell it. Since the strategy disconnects itself will it reconnect where it left off on Sunday. Will the Positions[0] object be accessible on Sunday when the market opens again. What if I created a custom global variable that I’m trying to monitor since the entry on Friday. Will this remain in memory? Is there a function/process that gets run when a strategy disables itself when market closes and when the markets reopen. Any help would be much appreciated.



    #2
    Hello bc24fl,

    Thank you for the post.

    I wanted to clarify, by disconnects do you mean that your connection is disconnected which in turn disabled the strategy?

    In any case if the strategy is being disabled while you have an existing position, the next time you re enable the strategy it would need to utilize its start behavior. Depending on the behavior used will determine if that position can be seen again or not.
    https://ninjatrader.com/support/help..._positions.htm

    Since the strategy disconnects itself will it reconnect where it left off on Sunday.
    No, if it was disabled you would need to re enable it when you want it to run.

    Will the Positions[0] object be accessible on Sunday when the market opens again.
    Only if your strategy equates the same set of orders/position again as historical. When you start it back up it will now need to re process the bars as historical. So long as the orders and logic executes in the same way as it did before it was disabled, it could resume any orders or positions. This relates to what start behavior is selected, likely immediate submit sync account would be needed.
    What if I created a custom global variable that I’m trying to monitor since the entry on Friday. Will this remain in memory?
    If your strategy is being disabled, all the variable it holds would no longer be able to be referenced. When you re enable it you would need to utilize the start behavior to have it resume what it was doing.

    Is there a function/process that gets run when a strategy disables itself when market closes and when the markets reopen. Any help would be much appreciated.
    The only part which is run when the strategy is disabled would be OnStateChange and its Terminated state. When the market re opens, if the strategy was previously disabled you would now need to re enable it again otherwise nothing should happen and it will remain disabled. Upon starting the script its start behavior is run which can attempt to sync the position.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Sorry I did not mean I disabled the strategy. It makes sense if i disable it i will lose all in memory. My intention is to let the strategy run 24/7 however when the market closes on Friday will it continue to remain in memory on the closed hours of Sat and partial Sun?

      So as long as the strategy stays enabled (even on market closes) I should NOT need to sync account?

      Comment


        #4
        Hello bc24fl,

        Thank you for clarifying.

        Yes that is a different situation, if you are not disconnecting and your strategy is not being disabled, it is still running and is aware of the information it has already collected. The start behavior and the other information i provided would be in the situation where you are either disconnected which in turn also disabled the strategy or where you just disable it yourself. As long as it remains running, it could pick up again once you have market data in the next session.



        I look forward to being of further assistance.

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by learningnt, Yesterday, 10:21 PM
        0 responses
        2 views
        0 likes
        Last Post learningnt  
        Started by GMiller64, Yesterday, 01:13 PM
        3 responses
        10 views
        0 likes
        Last Post GMiller64  
        Started by itrader46, Yesterday, 12:51 PM
        5 responses
        43 views
        0 likes
        Last Post rithikanth  
        Started by hemlock, Yesterday, 11:45 AM
        3 responses
        14 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by gbulle, Yesterday, 11:31 AM
        4 responses
        12 views
        0 likes
        Last Post gbulle
        by gbulle
         
        Working...
        X