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 Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      630 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      566 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X