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 argusthome, Yesterday, 10:06 AM
      0 responses
      20 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      18 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      14 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      9 views
      0 likes
      Last Post TheRealMorford  
      Started by Mindset, 02-28-2026, 06:16 AM
      0 responses
      38 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Working...
      X