Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to develop a trailing buy stop or trailing sell stop?

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

    How to develop a trailing buy stop or trailing sell stop?

    I'm trying to develop a strategy that allows me to have a trailing buy stop or trailing sell stop. Once the stop is hit, I have an ATM strategy that will activate. However, how can I get a trailing buy stop or sell stop to work in Ninja?


    Example:



    I want to enter a trailing buy stop on the dom anywhere above the market price.(and not have it immediately move to 4 ticks away from market price)

    I want the buy stop to follow the market down every time the market falls by 4 ticks.

    Once the buy stop is triggered, I want a profit of 4 ticks and stop loss of 12 ticks.(ATM)



    And:



    Just the opposite with a trailing sell stop

    I want to enter a trailing sell stop on the dom anywhere below the market price..(and not have it immediately move to 4 ticks away from market price)

    I want the sell stop to follow the market up every time the market increases by 4 ticks.

    Once the sell stop is triggered, I want a profit of 4 ticks and stop loss of 12 ticks.(ATM)

    I have the ATM ready to go, but cant find a way to do trailing buy/sell stops>

    Tradovate has a simple bracket strategy that does this, see attached.
    Attached Files

    #2
    Hello jb805,

    Thanks for your post.

    ATM strategies would be used to automatically deploy stop loss and profit target orders upon execution of the entry order.

    ATM strategies also have a Chase feature for entry orders where you can have the entry order chase after the current market price for as many ticks as you specify with Chase Limit.

    More information on Auto Chase can be found here - https://ninjatrader.com/support/help...auto_chase.htm

    Trailing stops for your Stop Loss can be set up in a Stop Strategy.

    Stop Strategies - https://ninjatrader.com/support/help...p_strategy.htm

    Auto Trail - https://ninjatrader.com/support/help...auto_trail.htm

    Our publicly available ATM 301 tutorial goes further into making Auto Trails - https://www.youtube.com/watch?v=DH9y-j64X1U

    Auto Chase will not allow incremental movement of the entry orders, so you could not have the entry order move with X number of ticks seen.

    If you want to go as far as having an entry order move in incremental movements, it would be best done with a fully automated NinjaScript strategy, where the strategy is programmed to submit the entry order and modify the entry order with X number of ticks seen. To get started with NinjaScript strategies, I recommend starting with out Strategy Builder 301 course and then to test our various conditions and actions examples, and then to incorporate logic in a larger strategy.

    Strategy Builder 301 (publicly available resource) — https://www.youtube.com/watch?v=_KQF2Sv27oE

    Conditions examples —https://ninjatrader.com/support/help...on_builder.htm

    Actions examples — https://ninjatrader.com/support/help...us/actions.htm

    If you would like more information on programming NinjaScript strategies, please open a new thread in our Strategy Development forum.

    We look forward to assisting.

    Comment


      #3
      I'm new to Strategy Builder and I just want to know if it is possible to use an EMA to cross over the Keltner Channel (Middle) line as an entry? The thought is set a condition where an EMA would be used to trigger an entry once it crosses over the middle line in the Keltner Channel.

      Comment


        #4
        Hello KosmonX,

        Yes that is possible, you could create a crossover condition using the EMA and comparing it against the keltner midline plot. If you are new to using the strategy builder I would suggest watching the following video on youtube that goes over its basic use, you can also find information in the linked help guide page.


        Comment


          #5
          Thank you for your assistance. i appreciate it. I have one other question. I followed the instructions in the video and it's actually entering trades now, but when the EMA crosses in the opposite direction, the strategy changes direction as well. Am I missing something or is this what happens when using the Strategy Builder?

          Comment


            #6
            Hello KosmonX,

            That would be correct, if you call the opposite entry method that will reverse the position. To prevent that you would need to make a position check as part of your condition to make sure the strategy is flat before trying to enter. https://ninjatrader.com/support/help...ionComparisons

            Comment


              #7
              Thanks again Jesse. To be clear, set the condition for Market Position Flat, on the same set (set1) or on set 2 (exit position)?

              Comment


                #8
                Hello KosmonX,

                You would need that on your entry conditions to prevent reversals.

                Comment


                  #9
                  Got it Thanks again!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  80 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  46 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  29 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  32 views
                  0 likes
                  Last Post TheRealMorford  
                  Started by Mindset, 02-28-2026, 06:16 AM
                  0 responses
                  66 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Working...
                  X