Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to check for for orders

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

    How to check for for orders

    Hello,

    I've got a strategy using unmanaged orders with SetStopLoss & SetProfitTarget. I want to enter a limit order only if there are no other limit or active orders. My code is this:

    if (my condition exists && entryOrder==null) entryOrder = EnterLongLimit(....)

    The issue is that my strategy only executes once. I'm guessing if my stop loss or profit target are hit, entryOrder does not automatically get set back to null. How can i either set it back to null myself, or simply check there are no active or limit orders present before executing my trade?

    Newbie question I'm sure, but i've scoured the manual and search the forums. Still scratching my head.

    Thanks.

    #2
    Hi TheWolf, I'm not sure how you've got the unmanaged strategy to work with the Set orders, those would be only part of the managed mode. In unmanaged you only have 3 actions

    SubmitOrder
    ChangeOrder
    CancelOrder

    You would set the entry IOrder value to null yourself in OnExecution() for example when the fill was received and it's not in PartFilled state - http://www.ninjatrader.com/support/f...ead.php?t=7499

    Comment


      #3
      Hi Bertrand,
      Sorry, my mistake, I'm using managed orders. Your OnExecution() solution will work. Thanks for your help!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      102 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      144 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      71 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      125 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      79 views
      0 likes
      Last Post PaulMohn  
      Working...
      X