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 argusthome, 03-08-2026, 10:06 AM
      0 responses
      111 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      59 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      38 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      41 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      78 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X