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 joselube001, 05-10-2024, 12:17 PM
              4 responses
              19 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by lorem, 04-25-2024, 09:18 AM
              17 responses
              75 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by DawnTreader, 05-08-2024, 05:58 PM
              21 responses
              81 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by doihaveto13, Today, 12:46 PM
              2 responses
              4 views
              0 likes
              Last Post doihaveto13  
              Started by Vitamite, Today, 12:48 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Working...
              X