• 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

Questions on StartBehavior.ImmediatelySubmit

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

    Questions on StartBehavior.ImmediatelySubmit

    Hi,

    I've been reading up on "Syncing Account Positions" in the NT8 documentation, and would like to understand further on the "Immediately Submit" option. I have the following questions:

    1) The documentation states that "Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled." Is there any way to avoid canceling these active orders on the account? I'm asking because there could be a scenario where I had to disable the strategy to make some NinjaScript modifications. Upon restarting, the active orders already on the account (generated from the previous version of the strategy) may not match any of the newly modified strategy's active orders. Nonetheless I may still want to retain these active orders as they may still be valid / desirable for me.

    2) If there is a way to retain these active orders on my account, will NT receive any notifications when their states change? i.e. will OnOrderUpdate be triggered when any of these active orders get filled? I'm asking because these active orders originated from the previous version of the strategy, hence I'm not sure if their state changes will be registered or ignored by the newly modified strategy.

    Greatly appreciate any clarifications you can provide, thanks.

    #2
    Hello Vypre,

    Thank you for the post.

    The account sync system was designed to handle orders from the running the same logic. If you modify the script, it would be different from the outcome of the previous run. There's no supported way of doing this, I could not provide any examples of how to do this, unfortunately.

    Any orders that are made after the strategy is disabled will not be managed by the strategy anymore, so the orders themselves will not give you any updates. Only orders that are considered matching after the synchronization will be added back to the order update event system.

    Please let me know if I can assist further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi Chris, thanks for the explanation.

      I have another query from the "Immediately Submit" section under "Syncing Account Positions" - There's a statement in this section which says "Any remaining active strategy orders that cannot be successfully paired will be submitted live...". To help me better understand this statement, assume I have the following scenario:

      1) Let's say I have a new trading account, hence this account would be flat to begin with.
      2) My strategy's StartBehavior is set to "ImmediatelySubmit" (btw I understand in this scenario it would be more appropriate to set to "WaitUntilFlat" instead, since my account is flat. But just for the purposes of this discussion, assume I use "ImmediatelySubmit").
      3) When I run my strategy, based on historical data my strategy had filled an EnterLongLimit order at $10 and placed a corresponding ExitLongLimit order at $12.
      4) Then when the strategy transits to live trading starts, the current price is $11.

      Based on the above mentioned positions built by my strategy from historical data (i.e. one EnterLongLimit order filled at $10 and one ExitLongLimit waiting to be filled at $12), would both the EnterLongLimit and ExitLongLimit orders be submitted by the strategy when it transitions into live trading? I'm thinking it should; since the new account is flat and there are no orders for my strategy to pair with, this would fulfill the statement "Any remaining active strategy orders that cannot be successfully paired will be submitted live...". Is my understanding correct?

      But if both orders are indeed submitted, how would they be implemented? Since the current price is $11, I assume the EnterLongLimit order at $10 would not be executed and the ExitLongLimit order would not be placed (since EnterLongLimit is not filled)?

      Comment


        #4
        Hello Vypre,

        Thank you for the reply.

        That is correct, if the orders match the strategies logic exactly, those orders will be managed by the strategy. As long as the price did not move above or below the limit prices, then they will still be valid orders. Remember that when NinjaTrader looks for active orders that match the strategy orders, those orders are already live on the account, not the virtual orders that are calculated when in historical mode.

        If you synchronize your account to the strategy position and the market price has not gone above or below your protective orders, the entry price will be somewhere in between the protective orders. This scenario would require the strategy to have made a position with those protective orders, disabled the strategy, exited the position manually and not canceling the protective orders, then re-enabling the strategy with Immediately Submit, Syncronize account selected.

        Please let me know if you have any questions.

        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris, thanks again for clarifying.

          A quick check - with reference to "Any active orders on the account previously generated by the strategy that does not match* an active strategy order will be cancelled.", will NT8 receive any notifications for these cancellations? i.e. will OnOrderUpdate be triggered upon these cancellations?

          Based on your earlier feedback, I believe NT8 will not receive any notifications; I just wanted to confirm on this, thanks.

          Comment


            #6
            Hello Vypre,

            Thanks for the reply.

            Confirmed, OnOrderUpdate will not be called for those canceled orders. They are considered to be outside of the strategy at that point.

            Please let me know if I can assist further.
            Chris L.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by pulpiwapi, 03-04-2019, 11:18 PM
            11 responses
            146 views
            0 likes
            Last Post music_p13  
            Started by indy73, Yesterday, 10:52 PM
            3 responses
            18 views
            0 likes
            Last Post sledge
            by sledge
             
            Started by priceisking, Today, 12:51 PM
            1 response
            21 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by chartish, Today, 10:33 AM
            3 responses
            28 views
            0 likes
            Last Post chartish  
            Started by casabella, Today, 11:51 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Working...
            X