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

Comment