PSAR Value

Created at 26 Jan 2013, 08:56
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
FX

fxpathway

Joined 26.01.2013

PSAR Value
26 Jan 2013, 08:56


 

Hi Support

I am looking at the PSAR value in the chart and compare that psar.Result.LastValue during the backtesting.

Both value does not seem to match. The value in the chart does not math the value that I get from psar.Result.LastValue.

 

Any explanation on this, will be much appreciaated.

 

Cheers,


@fxpathway
Replies

admin
29 Jan 2013, 10:39

Please use this code to compare the values at the index prior to the index of the current bar.

        ParabolicSAR psar;
            
        protected override void OnStart()
        {
            psar = Indicators.ParabolicSAR(0.02,0.2);
        }
        protected override void OnBar()
        {
            int index = MarketSeries.Close.Count - 1;
            double psarValue = psar.Result[index-1];
            Print("Open Time {0}", MarketSeries.OpenTime[index-1]);
            Print("P SAR Value {0}", psarValue);
        }




@admin