Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Detecting order processed to initialise variables

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

    Detecting order processed to initialise variables

    Hi,

    I have been writing a strategy (on bar close) that keeps track of a number of variables (basically keeping track of pivot points). If the correct sequence does not appear, the strategy re-initialises the variables so it can start searching again. If the correct sequence does appear, it enters a position and then trails a stop using either SetTrailStop or ExitLongStop. However with either of these stop options, I don't know when these orders have been triggered an exit from my position so that the strategy can re-initialise the variables to start searching for the next trade. Can someone please let me know how I can detect this?

    The only other way I have had this concept of reinitialising working in the past is to run the strategy on a tick-by-tick basis and then manually trigger ExitLong orders and reinitialise the variables at the same time. It is not my preference to have it running on a tick basis so if anyone could help, I would really appreciate it.

    Regards,
    Kylie.

    #2
    Kylie, if you're working with the Set() methods you would need to capture their token in the OnOrderUpdate() - http://www.ninjatrader.com/support/f...ead.php?t=5790

    The Exit() methods would directly offer IOrder access so you could check their states as needed.

    Comment


      #3
      Hi Bertrand,

      Sorry for the delay in responding but thank you very much for the information. I hadn't looked into this type of order monitoring but the reference samples are very helpful.

      Regards,
      Kylie.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      67 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      36 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      60 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      62 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X