Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Some Limit Orders Not Placed in Backtest

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

    #16
    Thank you Jesse.

    I believe I have found the reason that some limit orders are not being placed. After live testing my original strategy on some fast series today, I noticed that it is failing to place limit orders only if there is an active limit order on the other side of the market. If I remove the opposite side's order manually (meaning my Level object still believes it has an active order, but NinjaTrader knows there is not), then the submission stops failing. Do you know what may cause this issue? It happens with and without the loop and I believe it is an internal error or constraint, because my logic is working as expected.

    Comment


      #17
      Hello JagelBagel,

      This would be a violation of the internal order handling rules for the managed approach.

      From the help guide:
      "Methods that generate orders to enter a position will be ignored if:
      •A position is open and an order submitted by a non market order exit method (ExitLongLimit() for example) is active and the order is used to open a position in the opposite direction
      •A position is open and an order submitted by a set method (SetStopLoss() for example) is active and the order is used to open a position in the opposite direction
      •A position is open and two or more Entry methods to reverse the position are entered together. In this case the second Entry order will be ignored.
      •The strategy position is flat and an order submitted by an enter method (EnterLongLimit() for example) is active and the order is used to open a position in the opposite direction
      •The entry signal name is not unique​"


      If you want to have opposing orders working orders, you would need to use the unmanaged approach and submit orders with SubmitOrderUnmanaged().
      Chelsea B.NinjaTrader Customer Service

      Comment


        #18
        Okay thank you ChelseaB. The weird thing is that it only did that sometimes, and even if I didn't cancel all orders on the opposite side submit would work once any random one was cancelled manually.

        For anyone else who may be having a similar issue and doesn't want to use the unmanaged approach, my solution was to have only one level active at a time and this works fine for my specific strategy. I got the closest level, and had that order active until it was filled or it was no longer the closest level.

        Thank you Jesse and ChelseaB for your help and suggestions!

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Yesterday, 05:17 AM
        0 responses
        66 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        141 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        76 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        47 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        51 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X