Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order.State about limit/stop orders

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

    Order.State about limit/stop orders

    Hello,

    On OnOrderUpdate, please could you tell me why the behaviour about Order.State is different for LIMIT and STOP orders?

    The sequence about LIMIT order is (Submitted > Accepted > Working) in same time ... and then when price touch (Filled).

    The sequence about STOP order is (Submitted > Accepted) in same time ... and then when price touch (Working > Filled).

    I see that is the same in the Orders panel of NT .. LIMIT has Working State but STOP doesn't have (only Filled).


    Finally ... I need to get the place of the orders, I can use Working for LIMIT but for STOP what must I use ... Accepted? Why this difference?

    Many thanks.

    Click image for larger version

Name:	imagen.png
Views:	216
Size:	221.4 KB
ID:	1274055

    #2
    Hello ClauTrade,

    Thanks for your post.

    So we may accurately assist, please answer all the questions below.
    • What version of NinjaTrader are you using? Please provide the entire version number. This can be found under Help -> About (Example: 8.?.?.?)
    • Who are you connected to? This is displayed in green on the lower-left corner of the Control Center window.
    • What instrument symbol (and expiry if applicable) have you selected? For example, ES 03-22, AAPL, EURUSD, etc.
    • (For a chart) what interval is selected? For example, 5 minute, 1 day, 2000 volume, 4 Renko, etc.
    • Are the Stop orders Stop Market orders or Stop Limit orders?
    • How exactly are you defining the Limit orders and Stop orders in your script?​
    Please also send us a simple reduced exported test script and the steps and settings you are using to reproduce this behavior so we may investigate further.

    Note that a reduced copy refers to a copy of the script that contains the minimum amount of code needed to reproduce the issue. All other code is commented out or removed.

    To create a copy of your script to modify, open a New > NinjaScript Editor, select your script, right-click in the Editor, select 'Save as', name the script, and click OK.​

    To export a script, go to Tools > Export > NinjaScript AddOn.

    I look forward to assisting further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Hello Brendon,

      many thanks for your availability but after more test I think that the problem is in platform.

      I found and tested your sample code strategy "ProfitChaseStopTrailUnmanagedExample" and I got same issue.
      I test Playback and various instrument symbol
      I test SIM in real time
      I test in manual mode placing LIMIT ORDER and STOP ORDER

      Finally I test placing manual orders in REAL ACCOUNT and ONLY THERE it works fine.

      The behaviour in the tested strategy is the same that in manual mode ...the STOP ORDERS does not enter in WORKING status like the LIMIT ORDERS ... so the problem is something in demo accounts (playback and sim) that work different from real account.

      Below two img in real time ..placing manual orders in SIM account and in REAL ACCOUNT.

      I'm using last NT version 8.1.1.7 64-bit, I have reset and repair Database and reloaded the historical data before testing.

      Hope we can find the solution because these are important differences testing strategies ..and more using Unmanaged Approach​!

      Many thanks.

      Click image for larger version  Name:	imagen.png Views:	0 Size:	119.8 KB ID:	1274214

      Click image for larger version  Name:	imagen.png Views:	0 Size:	126.3 KB ID:	1274215
      Last edited by ClauTrade; 10-22-2023, 05:42 PM.

      Comment


        #4
        Hello ClauTrade,

        Thanks for your notes.

        Yes, this is the expected behavior of Stop Market orders when submitting them to the Sim101 account compared to a live account.

        The OrderState of the Stop Market order will vary from broker to broker meaning that the OrderState could show as 'Accepted' or as 'Working' depending on the broker you use.

        In your script, you could make sure to check for both OrderStates to see if the OrderState of the order is equal to OrderState.Accepted or OrderState.Working. An example of this could be found on around line 149 in the ProfitChaseStopTrailUnmanagedExample script you mentioned.

        Please let us know if we may assist further.
        Last edited by NinjaTrader_BrandonH; 10-23-2023, 08:43 AM.
        <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

        Comment


          #5
          Hello Brendon,

          ok ... happy to know that it was not an issue!

          Many thanks

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          44 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          48 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X