Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Trail stop at high of a pullback

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

    Trail stop at high of a pullback

    I am trying to create a trailing stop for a strategy that will place the stop order (for a short position) at the high of a pullback plus 1 tick and the reverse for a long position. I have not been able to figure out how to determine the correct bar in the pullback. I have attached a screen shot showing which bar I am trying to identify.

    Thanks
    Attached Files

    #2
    Originally posted by mlarocco View Post
    I am trying to create a trailing stop for a strategy that will place the stop order (for a short position) at the high of a pullback plus 1 tick and the reverse for a long position. I have not been able to figure out how to determine the correct bar in the pullback. I have attached a screen shot showing which bar I am trying to identify.

    Thanks
    Seems you are looking for the Swing indicator that ships with NT? No?

    Comment


      #3
      I did an example for you.

      and yes its a bit complex but it was my first idea on how to do it and i just went with it.

      If you have questions regarding the code, just ask.

      make sure also to use the right declarations when using this (line1)

      tho i think i didnt make a mistake, it still is possible, but after all its just supposed to show the way it can be done. you have to do the rest from here.

      EDIT: Note that with this version you would only start looking for retracements once you enter a position. so you cant access retracements b4 that point. if you wanna do that you would have to make a few changes, but i think if you understand how the code works, you can easily make your own adjustments
      Attached Files
      Last edited by BigRo; 11-07-2015, 05:26 PM.

      Comment


        #4
        Thank you for taking the time to create this! I'll see how I can use it.

        Comment


          #5
          Originally posted by mlarocco View Post
          Thank you for taking the time to create this! I'll see how I can use it.
          I'm no expert, but it seems to me that you can code this by accessing

          Swing(strength).SwingHigh[0]

          or

          Swing(strength).SwingLow[0]

          in your code by placing exits N ticks above/below those.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by GussJ, 03-04-2020, 03:11 PM
          11 responses
          3,221 views
          0 likes
          Last Post xiinteractive  
          Started by andrewtrades, Today, 04:57 PM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Started by chbruno, Today, 04:10 PM
          0 responses
          6 views
          0 likes
          Last Post chbruno
          by chbruno
           
          Started by josh18955, 03-25-2023, 11:16 AM
          6 responses
          436 views
          0 likes
          Last Post Delerium  
          Started by FAQtrader, Today, 03:35 PM
          0 responses
          9 views
          0 likes
          Last Post FAQtrader  
          Working...
          X