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 NullPointStrategies, Yesterday, 05:17 AM
      0 responses
      79 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      148 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      79 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      52 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      58 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X