Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy with trailing stop based on high/low of previous bar +- some input value

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

    Strategy with trailing stop based on high/low of previous bar +- some input value

    I am attempting to build a strategy with a trailing stop that is based on the High/Low (short position/long position) of the previous bar +- some input value. I can't see any coding method for that within the strategy builder stop and target section. Is this possible and can you provide me some examples of how it would be coded

    #2
    Hello gjbeaudin,

    Thank you for your inqiry.

    The Set methods in the Stops and Targets section of the Strategy Builder only allow for simple stops and targets that cannot be changed dynamically. Programming by hand will offer more flexibility, but you can also create your own logic in Conditions and Actions that controls how you would like to exit.

    We can not offer services to design strategy logic in the support department, but you may conceptualize the following as an example of using Exit orders to mimic Trail stop functionality:
    1. If the strategy is flat, set a bool to controlling your auto trail behaviors to false. Then Enter.
    2. If the strategy is not flat and some condition happens that you would like to trigger your auto trail, set the bool to true.
    3. If the strategy is not flat and the bool is false, place your initial stop loss as an Exit Order.
    4. If the strategy is not flat and the bool is true, modify the Exit Order in association to the current market price.
    More information on using the Strategy Builder can be found below.

    Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt90GAs9k

    I'm also attaching a basic example of setting this functionality up in the Strategy Builder.

    Please let us know if we may be of further assistance to you.
    Attached Files

    Comment


      #3
      Originally posted by gjbeaudin View Post
      I am attempting to build a strategy with a trailing stop that is based on the High/Low (short position/long position) of the previous bar +- some input value. I can't see any coding method for that within the strategy builder stop and target section. Is this possible and can you provide me some examples of how it would be coded
      Don't know if you ever found a solution, but both of these use different methods but do what you are asking:

      1) https://ninjatraderecosystem.com/use...bot-indicator/
      2) https://ninjatraderecosystem.com/use...er-entry-v4-2/

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      78 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X