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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      47 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      15 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      21 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      23 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X