Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Shifting Trailing Stop Only On Bar Roll Over

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

    Shifting Trailing Stop Only On Bar Roll Over

    I have a strategy that takes entries during the bar's period - hence calculate on bar close must be set to false. However I need to tell my trailing stop to only advance after a candle has closed (i.e. at the very beginning of the next candle) - or at bar roll-over if you will. It may be worthwhile mentioning that I am doing the trailing stop logic manually so I have much control - not using the SetTrailStop() call to set it. Instead I'm using ExitLongStop() and ExitShortStop() which I am nursing manually in onBarUpdate().

    So I imagine I just need to know when the onBarUpdate() method gets called for a particular candle for the very first time. Yes, I could use Time[0] and use some type of reset mechanism when I see the minute interval change (I'm using minute charts with this) but there must be a more elegant way

    Thanks,

    Molecool
    Last edited by molecool; 02-27-2013, 06:50 AM.

    #2
    You can use FirstTickOfBar to reset your ExitLong/ShortStop() which would move the stop only when a new bar opens.

    We have a reference sample to demonstrate these concepts:



    Please let me know if you have any questions.
    MatthewNinjaTrader Product Management

    Comment


      #3
      Originally posted by NinjaTrader_Matthew View Post
      You can use FirstTickOfBar to reset your ExitLong/ShortStop() which would move the stop only when a new bar opens.

      We have a reference sample to demonstrate these concepts:



      Please let me know if you have any questions.
      Awesome - that'll work just fine. Many thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      64 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      35 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      59 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
      51 views
      0 likes
      Last Post CarlTrading  
      Working...
      X