Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

understanding how to implement trailing and parabolic stops into my strategy

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

    understanding how to implement trailing and parabolic stops into my strategy

    Hi Emily, could u please start a new ticket with me here?

    I've built now a few basic strategies to get some bearing. I need some help with my understanding how to implement trailing and parabolic stops into my strategy.

    After price goes 10 ticks into my favor to move stop to breakeven +1 and then after 20 ticks move to +10 ticks and to keep trailing stop in that fashion.
    I played with those features but got a mix bag of things.
    Attached Files

    #2
    Hello trdninstyle,

    I've moved your post to a new forum thread as this is not related to the forum thread this was originally posted in.

    Moving forward, please be sure to start a new forum thread in the appropriate section of the forums for each inquiry you have that is a new topic.


    With a breakeven, this would have to be done with logic in the conditions and actions using exit orders.

    Below is a link to an example.


    The fromEntrySignal of an exit order attaches the exit to an entry order that matches the signalName.

    The 'Automate Your Trading with NinjaTrader's Strategy Builder' training video linked in the forum post below discusses this.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      The first link u gave is more of what I'm after, the 2nd link u gave are two videos of which I have already watched which demonstrate the very basics. They are very good videos done by you.

      I haven't come across any videos of showing how to create trailing stops and parabolic stops.
      I have to read the first link and digest it then attempt to implement trailing or parabolic stops into my strategy.
      So, I have to go into the conditions and actions for my exit orders? That does make sense.

      If there are any videos showing how to create the Acceleration, Acceleration max, Acceleration step, from entry signal, how it's done, it's easier for learning.
      You can see in my pic above that I didn't know exactly how to apply the proper #'s in the right places. Just guessing.

      Comment


        #4
        Hello trdninstyle,

        There are not any videos covering the parabolic stop type of order, the only information for that would be its help guide page. You can use the parabolic SAR indicator to get a better idea of how those values affect the parabolic SAR by visualizing it on a chart.



        Comment


          #5
          Here is what I'm looking for, I made a copy & unlocked the builder and I'll start applying things by the end of the day I'll be a little further.
          Attached Files

          Comment


            #6
            Thanks Jesse, I'll look at those too. It didn't update when I posted my last, didn't see u there.

            Comment


              #7
              Hello trdninstyle,

              I wouldn't be able to tell you what value to use for the part of the builder image you highlighted, you would have to figure out what values you wanted to use based on your trading goals. The part of the builder you pictured is the input parameters section, that would be a default value that is used if the user does not specify a different value in the user input when applying the script.

              The other image of the code you have highlighted some logic which is doing a break even by checking the positions average price and comparing it to the close. If you are trying to use the parabolic stop function that would not apply to the sample script you have shown because it already has logic to control the stop by using logic. The parabolic stop works like the SetStopLoss or SetTrailStop functions where you don't need logic to control it, you just specify values to use with that stop. The help guide sample for SetParabolicStop shows how that method is used, you can also use that in the builder without unlocking it by using the stops and targets page.

              Comment


                #8
                I copy/paste very carefully the 'Sample Using OnOrderUpdate' into my script making sure to stay between the brackets. I commented out the other logic that controlled my stop and target.

                I do understand I need to remove the logic for stop & target that I currently have in order to use SetStopLoss or SetTrailStop functions. That pic I showed I was asking for an example of what #'s one would put in? For whatever goals someone would have, another words, I kno my goal but don't kno how to apply it here? So, say to make 10 ticks, what would the #'s be?? You can't fill in an example for me? There's no video. Where do I put the 10? where would I put the breakeven +1?

                In the 1st pic there is one error, what is it asking me to fix?
                Attached Files
                Last edited by trdninstyle; 10-24-2022, 01:15 PM.

                Comment


                  #9
                  My question is in the pic guys
                  Attached Files

                  Comment


                    #10
                    Hello trdninstyle,

                    The sample you are using would not really be a good starting point if you are trying to use the Set methods for targets. It would be better to just start a new empty strategy in the strategy builder and then use the stops and targets page for that use case. You are going to have to remove the OnOrderUpdate/OnExecutiionUpdate/OnBarUpdate logic in that sample to get back to a point where the target is not being controlled by logic.

                    If you are trying to do actions like a break even then you would generally not want to use the set methods for that purpose. That sample controls the order pricing by using logic. In that sample it offsets the price by 7 ticks using the following line:
                    Code:
                    if (Position.MarketPosition == MarketPosition.Long && Close[0] >= Position.AveragePrice + (7 * (TickSize / 2)))
                    You could replace the 7 with whatever number suits your goals such as 10 if you wanted a break even of 10 ticks.

                    Alternatively you can see the following example for the strategy builder that does a break even: https://ninjatrader.com/support/foru...rategy-builder
                    That would be a good starting point for a break even, that uses OnBarUpdate and conditions to specify where the break even happens. You can also define new sets to complete additional actions if needed. The sample from the help guide is more targeted at manual coding and how to find/use Order objects for more advanced tasks, it just happens to have a break even in that sample also.





                    Comment


                      #11
                      Hey Jesse, now this is what I'm talking about! I can see firsthand how it's done and copy that. Instead of not having a clue. lol
                      Thanks for the two items in strategy builder so I can take a look at. Thumbs up my-man Jesse.

                      Comment


                        #12
                        Okay, this makes it so much easier now. For my initial condition and 'Do the following' (when that happens), I just keep that the same as Set 1, Set 2 (for opposite) and THEN continue with Set 3, set 4, set 5, set 6, set 7. (The initial 1-5, just adding my first two in front of it)

                        And continue to copy the rest of it.

                        I did start a brand-new strategy builder for this.
                        Attached Files

                        Comment


                          #13
                          Hello trdninstyle,

                          To add more sets you would need to insert them before set 5 and after the first few sets which configure variables and the TriggerState. The conditions and actions of set 5 needs to always be the very last set so that the order is re submitted for each bar using the price values you set in the previous sets. You can adjust the second set to accommodate how you wanted to initially enter. The first set is used to reset the variables when flat.



                          Comment


                            #14
                            Yes, that makes good sense to place my original conditions first.

                            I'm using the TrailBuilderExample, I think that one works better for what I want.

                            Have a look at my inputs so far please, I'm having a hard target which is in the Stops & Targets, but not the stop, because it's not a hard stop anymore.
                            I want an initial - 40 tick stop (to stay away from the swings), but as soon as price moves 10+ticks in my direction to advance my stop to 41 ticks so it's B.E. +1

                            I'm pretty sure Jesse I'll need to add another input to have my stop to trail only 10 ticks after that initial 41 tick move up. And have it trail another 10 after a 20-tick advance.
                            And keep following behind current price every 10 ticks if I choose to or until it hits hard target.

                            Later I may not have a hard target just the trailing stop? At least to look at it.

                            My first input is the EMA and to trigger a long once there is a Price Bars Low above the ema and vice versa.
                            Without a moving stop, I get like 8 wins 3 losses and most losses are not the full -40 because it triggers the other direction, sometimes an 18-tick loss instead, it varies.
                            This is why I want to figure out how to trail my stops.
                            Attached Files
                            Last edited by trdninstyle; 10-25-2022, 11:30 AM.

                            Comment


                              #15
                              Hello trdninstyle,

                              You could see the break even sample for the steps on how to move a target to breakeven. The trail example and break even work very similar. You would have to add additional sets and states to do additional movements. Both samples show 1 concept each. The break even only breaks even and the trail does a trailing target by a fixed amount at a specified interval.



                              To do anything addition would require adding more sets and conditions to control those movements.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by NullPointStrategies, 03-13-2026, 05:17 AM
                              0 responses
                              86 views
                              0 likes
                              Last Post NullPointStrategies  
                              Started by argusthome, 03-08-2026, 10:06 AM
                              0 responses
                              151 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
                              59 views
                              0 likes
                              Last Post TheRealMorford  
                              Working...
                              X