Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

trailing trigger in certain point

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

    trailing trigger in certain point

    i just wonder if i can use the trailing in strategy builder such as trigger the trailing for example: when i win 40 ticks, then trailing will start with the distance -20 tick

    #2
    Hello trongle1212,

    Welcome to the NinjaTrader forums!

    Yes, this is possible using Exit orders by calculating a trigger distance for when the trail action should next update, and a trail distance to supply to the exit order method.

    Below is a link to an example that opens in the Strategy Builder.


    I also recommend watching the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello trongle1212,

      Welcome to the NinjaTrader forums!

      Yes, this is possible using Exit orders by calculating a trigger distance for when the trail action should next update, and a trail distance to supply to the exit order method.

      Below is a link to an example that opens in the Strategy Builder.


      I also recommend watching the 'Automate Your Trading with NinjaTrader's Strategy Builder' training video.
      https://ninjatrader.com/support/foru...pts#post786040
      I saw the build is just for long only

      Comment


        #4
        Hello trongle1212,

        Yes, the example is limited as it is trying to express an idea. Save the price plus a number of ticks to a variable as the trigger, save the price minus a number of ticks to a variable as the working stop price. When the market price is above the trigger price, update the trigger price to the market price plus number of ticks to the trigger variable, update the stop price to the market price minus a number of ticks.

        This same concept can be applied to short positions as well using the opposite values. Save the price minus a number of ticks to a separate variable as the trigger, save the price plus a number of ticks to a variable as the working stop price.
        To make things easy for the user, instead of adding more inputs for the short position trail frequency and trail distance, the developer can use a custom series in the strategy builder to do custom math and multiply the trail stop distance ticks by -1 for long positions and the trail frequency ticks number by -1 for short positions.

        As this does get requested frequently, i've added TrailLongShortBuilderExample_NT8 to the examples on this forum post.
        https://ninjatrader.com/support/foru...596#post806596
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello trongle1212,

          Yes, the example is limited as it is trying to express an idea. Save the price plus a number of ticks to a variable as the trigger, save the price minus a number of ticks to a variable as the working stop price. When the market price is above the trigger price, update the trigger price to the market price plus number of ticks to the trigger variable, update the stop price to the market price minus a number of ticks.

          This same concept can be applied to short positions as well using the opposite values. Save the price minus a number of ticks to a separate variable as the trigger, save the price plus a number of ticks to a variable as the working stop price.
          To make things easy for the user, instead of adding more inputs for the short position trail frequency and trail distance, the developer can use a custom series in the strategy builder to do custom math and multiply the trail stop distance ticks by -1 for long positions and the trail frequency ticks number by -1 for short positions.

          As this does get requested frequently, i've added TrailLongShortBuilderExample_NT8 to the examples on this forum post.
          https://ninjatrader.com/support/foru...596#post806596
          Hi Chelsea
          thank you for your reply
          i did create 1 with trailing, it work with replay, but not in realtime

          Comment


            #6
            Hello trongle1212,

            I've had to make modifications to submit an exit market order when the calculated price is above the bid / below the ask to avoid stop order rejections due to an invalid price.

            I've tested this example in real-time and it appears to be working without issue.


            Please re-download and import and test once more.

            If you follow the exact steps in this video using the script I have provided you, the behavior is different than what is shown in the video?
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_ChelseaB View Post
              Hello trongle1212,

              I've had to make modifications to submit an exit market order when the calculated price is above the bid / below the ask to avoid stop order rejections due to an invalid price.

              I've tested this example in real-time and it appears to be working without issue.


              Please re-download and import and test once more.

              If you follow the exact steps in this video using the script I have provided you, the behavior is different than what is shown in the video?
              done. thank you

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by llanqui, Today, 03:53 AM
              0 responses
              6 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              10 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              15 views
              0 likes
              Last Post AaronKoRn  
              Started by carnitron, Yesterday, 08:42 PM
              0 responses
              11 views
              0 likes
              Last Post carnitron  
              Started by strategist007, Yesterday, 07:51 PM
              0 responses
              14 views
              0 likes
              Last Post strategist007  
              Working...
              X