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

SampleOnOrderUpdate strategy issue

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

    SampleOnOrderUpdate strategy issue


    1. Our version of NinjaTrader is 8.0.18.1 64-bit.

    2. The strategy we're using is: SampleOnOrderUpdate.

    3. When the position of the strategy is 1L it generates its stop and target orders.

    4. If I disconnect the strategy and reconnect it again using Immediately submit as start behavior, it does not recognize old target and stop orders and generates new orders.

    5. When stop loss order condition is met, then all stop loss orders are filled, but only the last target order is cancelled. This causes a short position in the account. The rest of target orders remain in a working state.

    6. Looking in the forum, we found a "possible solution".

    https://ninjatrader.com/support/foru...ses-connection

    a. Activate Cancel exit orders when a strategy is disabled.
    b. Set Handling = Keep Running

    7. By doing this, the orders (target and stop loss) get cancelled when the strategy is deactivated,
    When the strategy activates again, generate new stop and targets orders but at different prices.

    We are using this strategy as an example for strategy development, because it uses Manage Approach to manipulate orders when resuming strategies.

    So. it still doesn't solve our problem.


    We hope you can help us. Thanks..
    Last edited by lismartin; 08-16-2019, 03:19 PM.

    #2
    Hello lismartin,

    When using Immediately submit the previously generated order can only match when the order action, order type, quantity, limit price, and stop price are exactly identical. Were there any differences between the two tests when you enabled the strategy? Did you completely remove and re apply it after disconnecting? If for any reason there was different data or one of the orders was evaluated differently you would see the outcome you have experienced.

    The item you found would be a solution as that cancels the orders and then re enters later when re enabling it, this is essentially the same as using Immediately submit because the orders are being cancelled/resubmitted at a new price. Both are solutions depending on how you look at it, this would be the expected behavior if an order cannot be matched so the solution is to cancel. It sounds like the situation you have used the strategy in had equated differently in the two use cases so the targets could no longer be matched causing this outcome.


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

    Comment


      #3
      Hello!. When you say "When using Immediately submit the previously generated order can only match when the order action, order type, quantity, limit price, and stop price are exactly identical". How can I do that? I Just reconnect the strategy in the same entry, the order should match.

      Comment


        #4
        Hello 7robert,

        Those details are the criteria which is used to match the order, you would do that by allowing your strategies logic to run.

        If the strategy ends up producing the exact same orders, they would be matched. If for any reason the orders do not match, they will not meet the criteria and would be cancelled.

        I am not certain I understand your statement about reconnecting, but the idea is that if you disconnect/reconnect and your logic allows for the same orders to be placed in historical processing it will try to resume the orders when you reach that point in processing. If it cannot resume the orders or has differences, you then run into the other actions in the sync setting such as cancelling orders or modifying the position.

        I look forward to being of further assistance.


        JesseNinjaTrader Customer Service

        Comment


          #5
          So.. I guess the logic of my strategy is wrong, any advice to create the logic and that it works for me?
          I was guided by the logic of sampleonorderupdate strategy
          Last edited by 7robert; 08-19-2019, 09:56 AM.

          Comment


            #6

            Hello Jesse, thanks for your reply.

            Please check the following video https://www.screencast.com/t/JsRN0tDOsJj
            In there I try to demonstrate the strategy behavior when disabling and re-enabling the strategy.
            Please notice:
            1. Stop Loss and Profit Target orders are duplicated when re-enabling the strategy.
            2. When current price reaches Limit price then
              • All Limit orders are filled
              • Only the last Stop Loss order is cancelled.
              • The rest of Stop Loss orders are in a working state
              • Account Position 1 Short.
            We are talking about a strategy that is in referenced in Ninja Trader's Documentation.


            I really hope you can help me

            Comment


              #7
              Hello lismartin,

              Thank you for the follow up, I will review this further and if I can reproduce this I will report it to development for further review.

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

              Comment


                #8
                Hello lismartin,

                After further review development has assigned a tracking id for this issue. The issue tracking ID is 13951. If you would like to email our platform support [at] ninjatrader.com I can provide an internal testing release if you would like to test that this situation is resolved. please note that internal releases are not a "stable point release" so it should only be used for the purposed of testing the single issue. If you email in please copy/paste a link to this thread so I can locate the inquiry.

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

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Waxavi, Today, 02:00 AM
                0 responses
                2 views
                0 likes
                Last Post Waxavi
                by Waxavi
                 
                Started by elirion, Today, 01:36 AM
                0 responses
                4 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by gentlebenthebear, Today, 01:30 AM
                0 responses
                4 views
                0 likes
                Last Post gentlebenthebear  
                Started by samish18, Yesterday, 08:31 AM
                2 responses
                9 views
                0 likes
                Last Post elirion
                by elirion
                 
                Started by Mestor, 03-10-2023, 01:50 AM
                16 responses
                391 views
                0 likes
                Last Post z.franck  
                Working...
                X