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
    BertrandNinjaTrader Customer Service

    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 rocketman7, Today, 02:12 AM
      5 responses
      23 views
      0 likes
      Last Post rocketman7  
      Started by trilliantrader, 04-18-2024, 08:16 AM
      7 responses
      28 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by samish18, 04-17-2024, 08:57 AM
      17 responses
      66 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by briansaul, Today, 05:31 AM
      1 response
      15 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Started by PaulMohn, Today, 03:49 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Working...
      X