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

SetParabolicStop

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

    SetParabolicStop

    Hi,

    Is it possible to see a practical example of the SetParabolicStop ? The onLine help is very superficial on this one.

    Thank you.
    Anthony

    #2
    Hello Anthony, thanks for your post.

    This has been answered previously in this post:
    https://ninjatrader.com/support/foru...t8#post1051543

    If any questions come up please let me know.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hi,

      I tried using SetParabolicStop but can't get it to work. I get no errors, my orders get filled but I don't see anything working besides the order. I defined it in the (State == State.Configure)
      SetParabolicStop("MyShortEntry", CalculationMode.Ticks, 50, false, 0.03, 0.3, 0.01)

      Thank you.
      Anthony

      Comment


        #4
        Hello Anthony thanks for your reply.

        Do you see any errors in the Log tab of the Control Center? Do you see anything coming from the TraceOrders when enabled? Here is more info on TraceOrders:



        I look forward to hearing from you.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          HI,

          Good morning !

          TraceOrders = true;

          I don't see any errors in the LOG tab, ORDERS tab shows an entry for the LONG/SHORT and another entry when the position is closed. What could it be ?

          Thank you.
          Anthony

          Comment


            #6
            Hello Anthony, thanks for your reply.

            The test script that I set up works fine on my end. Can you test this on your side? Place the attached strategy within Documents\NinjaTrader 8\bin\Custom\Strategies then compile. It will enter short at the close of the first real-time bar, so test on a 10 second chart and wait for a bar to close.

            I look forward to hearing of your results.
            Attached Files
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi,

              Yes, it works ! Thank you very much.

              I still don't know why it won't fire in my strategy. I have to look into it with more detail.

              Can I have this setup ? One for LONG another for SHORT ?

              if (State == State.Configure)
              {
              SetParabolicStop("MyLongEntry", CalculationMode.Ticks, 50, false, 0.03, 0.3, 0.01);
              SetParabolicStop("MyShortEntry", CalculationMode.Ticks, 25, false, 0.03, 0.3, 0.01);
              }

              Thank you.
              Anthony

              Comment


                #8
                Hi,

                According to the NT onLine help:

                Quote :
                fromEntrySignal The entry signal name. This ties the trail stop exit to the entry and exits the position quantity represented by the actual entry. Using an empty string will attach the exit order to all entries.
                :EndQuote

                No "entrySignalName" will tie the ParabolicStop to ALL entries. But, I would like to modify the parameters: Tick value, Accelaration, Accelaration Max & Accelaration Step, during runtime. Is it possible ?

                Thank you.
                Anthony

                Comment


                  #9
                  Hello Anthony, thanks for your reply.

                  To specify the stop for all entries with no signal name, leave the fromEntrySignal a blank string e.g. "" and make sure your entry orders have the same blank signal name or no signal name at all.

                  To change the parabolic stop parameters while it is an active order, call SetParabolicStop() again with the same signal name and updated parameters.

                  Please let me know if this does not resolve your inquiry.

                  Chris L.NinjaTrader Customer Service

                  Comment


                    #10
                    • Hi,

                      Can I have this setup ? One for LONG another for SHORT ?

                      if (State == State.Configure)
                      {
                      SetParabolicStop("MyLongEntry", CalculationMode.Ticks, 50, false, 0.03, 0.3, 0.01);
                      SetParabolicStop("MyShortEntry", CalculationMode.Ticks, 25, false, 0.03, 0.3, 0.01);
                      }

                      Thank you.
                      Anthony

                    Comment


                      #11
                      Hello Anthony, thanks for your reply.

                      Yes that is perfectly fine.

                      Chris L.NinjaTrader Customer Service

                      Comment


                        #12
                        Hi,

                        I have this setup:

                        Calculate.OnEachTick

                        if (State == State.Configure)
                        {
                        SetParabolicStop("", CalculationMode.Ticks, 25, false, 0.03, 0.3, 0.01);
                        }

                        Market Replay: 10/01/2020 - 10/02/2020 Time: 23:39:xx aprox.

                        I setup the strategy to close trades whenever the price moves against the entry price by X amount of ticks. And it works perfectly when I run the strategy WITHOUT a SetParabolicStop, but when I enable it the price moves against the entry price by more than X amount of ticks (sometimes even twice) and hits the ParabolicStop. I noticed that the ParabolicStop is only updated when a new bar is created even though "Calculate" is set to "OnEachTick". Is this an issue with NT ? or am I missing something ? The NT help says "Parabolic stops are amended on a bar update basis". Now,
                        ticks and price change also update bars, so why isn't my strategy seeing the ticks it normally sees when NOT using the Parabolic stop ?

                        Thank you.
                        Anthony

                        Comment


                          #13
                          Hello Anthony thanks for your reply.

                          The market price needs to move in favor of the position for the parabolic stop to move, not against the average price. Could you provide more context from the strategy so I can test on my machine?

                          I look forward to hearing from you.
                          Chris L.NinjaTrader Customer Service

                          Comment


                            #14
                            Hi,

                            I know that: (The market price needs to move in favor of the position for the parabolic stop to move, not against the average price). What happens is:

                            The strategy is set to fire on Calculate.OnEachTick and to close a position when the price moves against the close of the previous bar by X ticks. This works fine as long as the parabolic stop is disabled (commented out in the code).
                            When the parabolic stop is enabled, the strategy behaves as if the Calculate was set to ONBARCLOSE and the strategy misses ticks. The position is closed X+ ticks, sometimes a bar after.

                            Thank you.

                            Anthony

                            Comment


                              #15
                              Hello Anthony, thanks for your reply.

                              We have a full example using ParabolicSAR/SetParabolicStop here that uses the OnPriceChange calculate period. Does this example run properly for you?

                              Best regards,

                              -ChrisL
                              Attached Files
                              Chris L.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by andrewtrades, Today, 04:57 PM
                              1 response
                              4 views
                              0 likes
                              Last Post NinjaTrader_Manfred  
                              Started by chbruno, Today, 04:10 PM
                              0 responses
                              3 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
                              6 views
                              0 likes
                              Last Post FAQtrader  
                              Started by rocketman7, Today, 09:41 AM
                              5 responses
                              19 views
                              0 likes
                              Last Post NinjaTrader_Jesse  
                              Working...
                              X