Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Difference Between Indicator Values Calculated in Strategy vs. Painted On Chart

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

    Difference Between Indicator Values Calculated in Strategy vs. Painted On Chart

    Can someone please explain why I see value differences between a value returned when an indicator is called inside of a strategy and the value that can be seen when the same indicator is drawn on a chart?

    Here's the code in the strategy:
    psar = ParabolicSAR(psar_front,psar_middle,psar_back).Val ue[1];

    I use the fist bar back as I'm calling this from the First Tick of Bar. (the [0] bar returns "0")

    The values returned in this example are (see File1):

    ToTime Vstrat ~Vchart
    10000 3859.88 3875.0
    10500 3863.71 3879.5
    11000 3867.35 3883.0

    11500 3870.81 3887.0
    12000 3874.09 3890.5
    12500 3877.21 3894.5

    13000 3880.18 3892.0

    The value calculated in the strategy (Vstrat) seems like it is shifted in value to the value shown in the chart (~Vchart) or the other way around.

    Funny thing is if I stop running the strategy and open the indicator dialog box and hit "apply" the chart goes to the strategy-calculated values shifted by one bar. See File2.

    I have the same problem with other indicators: the value returned to my strategy is different than what is simultaneously drawn on a chart. This obviously makes building strategy logic difficult as the painted indicator is not what is being internalized in the strategy.

    Thanks!

    Larry
    Attached Files
    Last edited by epcompany; 06-15-2009, 10:53 PM.

    #2
    Larry, thanks for the post - please make sure you run the latest 6.5.1000.11 release version of NinjaTrader - this also contains the fixed ParabolicSAR indicator ('ParabolicSARFixed'), I would suggest retrying your strategies with this one then.

    Comment


      #3
      Bertrand,
      Thanks for the advice.

      However, I was using version 1000.9 and updated to both versions 1000.10 and 1000.11. The file you reference, ParabolicSARFixed, was not in either the .10 or .11 release. The file, @ParabolicSAR.cs dated 4/27/09, was identical in all three versions. I even discarded the NinjaTader folder and did a completely new install with the old file being the one that showed up.

      I noted that the release notes say that the new ParabolicSAR was released with 1000.10. It doesn't seem to be.

      Is there an alternate place where NT keeps these files, like somewhere on the forum?

      Thanks,

      Larry

      Comment


        #4
        Larry,

        As you reinstall have you tried deleting your My Documents\NinjaTrader 6.5 folder? You will lose everything when you do that and you will get a fresh reinstall. Please beware that it clears everything out when you do this so backup anything you want to keep beforehand.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Josh,
          As I said in the previous response to Bertrand, "I even discarded the NinjaTader folder and did a completely new install with the old file being the one that showed up."

          So, yes I have done what you suggest. As the problem seems to be nothing more than my needing the new .cs file for the ParabolicSAR, where else might I get it.

          Thanks,

          Larry

          Comment


            #6
            Larry,

            You have the new file if you have installed NinjaTrader 6.5.1000.10 or up. I have attached it here again for you anyways. Please replace your file and see if it works.
            Attached Files
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

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