Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ParabolicSAR called from strategy does not plot

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

    ParabolicSAR called from strategy does not plot

    I have 2 charts running ...both 1000 vol. One has only ParabolicSAR running and the other my strategy which adds ParabolicSAR with the same parameter settings.

    When I start the charts in MarketReplay the PSAR plots do not match. When I refresh the strategy chart, they match.

    Why does calling ParabolicSAR from the strategy make a difference to the plot?

    #2
    We will check this out.
    RayNinjaTrader Customer Service

    Comment


      #3
      thanks...in fact you do not need 2 charts

      just put PSAR in the chart as an indicator and also call it from the strategy....plots are not even close...until you refresh...then they plot on top of each other

      Comment


        #4
        only thing i can think of that might be different with my cs which might be a contributing factor to the problem is that i add a 1 min series which i use to pickup the opening price and set other flags for vol charts

        Comment


          #5
          Nt 6.5.1000.7

          I loaded the new .7 version of NT to test the new ParabolicSAR code to see if it would solve my problem

          I edited SampleAtmStrategy by adding ParabolicSAR and changing the strategy to CalculateOnBarClose = false.

          then added the strategy to the chart (red plot) and ParabolicSAR to the chart as an indicator (green dot).

          the difference in the plots comes from the strategy calculating on each tick

          my strategy requires calculation on each tick

          is there a way to use/edit ParabolicSAR so it works with CalculateOnBarClose = false?
          Attached Files

          Comment


            #6
            ATI user,

            Try creating a duplicate of ParabolicSAR on your end. Then edit it to remove the CalculateOnBarClose line from the indicator. Then try calling this one from your strategy. See if that does anything for you.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              thanks for the reply Josh

              per your suggestion, I removed the CalculateOnBarClose line from my PSAR

              I then called it from a strategy which calculates on every tick but does nothing but plot the PSAR (red dots)

              I added the same indicator to the chart (green plots)

              for historical bars you can see that they plot on top of each other...for new bars they do not

              there seems to be no way to use the indicator when called from a strategy that calculates during the bar

              is this a bug? is there a workaround? (perhaps plotting the value directly from the strategy on first tick of bar)
              Attached Files

              Comment


                #8
                Are you sure you are using the same CalculateOnBarClose for both the strategy and the indicator?

                Edit: Add the indicator onto the chart. Set it to CalculateOnBarClose = false. Then add the strategy. You will see they move in step with each other.
                Last edited by NinjaTrader_JoshP; 10-27-2008, 11:35 AM.
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  thought you said to remove the line from the indicator code ...which I did

                  in this pic, both the indicator and the strategy have false setting

                  difference still is the red dots (from the indicator as called from the strategy) are mostly wrong

                  what is it about the strategy call that changes the values?
                  Attached Files

                  Comment


                    #10
                    There is a known bug when you call indicators from strategies and they have differing CalculateOnBarClose settings.

                    On my end, they match up the same. Try adding the indicator with CalculateOnBarClose = false first. Then add your strategy. The dots overlap 100% historically and in real-time.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      ok...loaded 2 indicators with false setting

                      then an indicator with true setting

                      then strategy with false setting

                      the strategy plot overwrote the other 2 false setting plots...per your tip on adding order

                      unfortunately, the values of the false plots are not accurate when compared with the true setting plot...which is the plot I need to use....i.e. false setting values are all over the place for some reason

                      I assume at this point from our dialog that there is no way to receive true setting plots into a strategy that has a false setting ..correct?

                      if correct, then can you think of a workaround where I can get useful (true setting) values into my false setting strategy?

                      I should point out that I only need the closed bar value from the prior bar...not tick by tick values of the PSAR....i.e. the historical values are all on closed bars and are good values...and the PSAR with the true setting has good values....all the real time false values are useless

                      thanks
                      Attached Files
                      Last edited by ATI user; 10-27-2008, 03:27 PM.

                      Comment


                        #12
                        I see what you are saying now ATI user. The whole time I thought you wanted both strategy and indicator with false settings.

                        To get true values for the indicator you can probably tweak up the code. Do something like an all-encompassing if-statement in the OnBarUpdate():
                        Code:
                        if (FirstTickOfBar)
                        {
                             // Do the indicator
                        }
                        Remember that you will want to offset all [] back one when you do this method to mimic the CalculateOnBarClose = true setting.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          right..thanks.

                          they all stack now...I removed the cyan false setting plot

                          now the 2 false setting plots with the firsttickofbar code stack up with the true setting indicator plot...did not have to change [] back a bar
                          Attached Files

                          Comment


                            #14
                            Great. Glad you got it resolved.
                            Josh P.NinjaTrader Customer Service

                            Comment


                              #15
                              Josh

                              How about the opposite situation?

                              I have a different indicator which must calculate on bar close.

                              My strategy must calculate on each tick. So I have my cs getting the indicator value on the first tick of bar and I still get bad plots/values....even looking back one bar.

                              Is this because OnBarUpdate calls the indicator on each tick anyway? which then throws off the plots/values?

                              The indicator plots perfectly, and gives me perfect values, if I set my strategy to calculate on bar close (of course my cs then does not perform a lot of functions which must be done mid-bar)

                              Any ideas on work-around for this one?

                              Thanks.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                              0 responses
                              574 views
                              0 likes
                              Last Post Geovanny Suaza  
                              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                              0 responses
                              333 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by Mindset, 02-09-2026, 11:44 AM
                              0 responses
                              101 views
                              0 likes
                              Last Post Mindset
                              by Mindset
                               
                              Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                              0 responses
                              553 views
                              1 like
                              Last Post Geovanny Suaza  
                              Started by RFrosty, 01-28-2026, 06:49 PM
                              0 responses
                              551 views
                              1 like
                              Last Post RFrosty
                              by RFrosty
                               
                              Working...
                              X