Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How can a strategy know when a trade is stopped out via a TrailingStop

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

    How can a strategy know when a trade is stopped out via a TrailingStop

    Hi,
    I'm new to NT and this forum, so my apologies if this has been covered elsewhere (or if I've posted in the wrong place).
    I have a strategy that places a market order and a trailing stop. I am having trouble trying to find a reliable way of knowing within the code when this trailing stop exits the trade.
    I've been through the OnOrderUpdate, but at exit these methods/properties don't change.

    If anyone could offer some advice on how I can know when a trade is closed (I'm sure it can be done as it plots it on the chart) then I would be really appreciative.

    Thanks
    Steve

    #2
    Hi Steve, welcome to our support forums - a bit simplistic but for a start you could check if the strategy is flat (Position.MarketPosition - http://www.ninjatrader-support.com/H...tPosition.html).

    For advanced order tracking, you would need to work with the IOrder objects - http://www.ninjatrader-support.com/H...V6/IOrder.html

    This reference sample might also be helpful - http://www.ninjatrader-support2.com/...ead.php?t=7499

    Comment


      #3
      Thanks for that tip. I've given it a try and it appears to work well for what I need. Much appreciated.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by cmoran13, Yesterday, 01:02 PM
      0 responses
      29 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      21 views
      0 likes
      Last Post PaulMohn  
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      160 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      95 views
      1 like
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      148 views
      2 likes
      Last Post CaptainJack  
      Working...
      X