GPBUSD is the pair that I am running a backtest on.
My strategy code loads EURUSD data into a dataseries
otherprice = new DataSeries(this); Add("$EURUSD", PeriodType.Minute, BarsPeriod.Value);
If all of my previous assumptions are correct, then I am noticing something odd. My output console reports that the Opens[1][0] returns the open price 1 bar late.
$EURUSD sample data
20071001 010000;1.4268;1.427;1.4267;1.4269;12
20071001 010500;1.4268;1.427;1.4268;1.427;7
20071001 011000;1.4271;1.4271;1.427;1.427;2
20071001 011500;1.4271;1.4271;1.4267;1.4268;14
20071001 012000;1.4267;1.4268;1.4264;1.4264;8
$GBPUSD sample data
20071001 010000;2.0453;2.0454;2.0453;2.0453;3
20071001 010500;2.0452;2.0453;2.0444;2.0445;26
20071001 011000;2.0446;2.0447;2.0445;2.0445;3
20071001 011500;2.0446;2.045;2.0444;2.0444;19
20071001 012000;2.0443;2.0443;2.0442;2.0443;5
Output
AT 10/1/2007 1:00:00 AM | GBP=2.0453 EUR=1.4265Diff= 0.6188 NormDIff = -1.24264685245949
AT 10/1/2007 1:05:00 AM | GBP=2.0452 EUR=1.4268Diff= 0.6184 NormDIff = -1.63361918954248
AT 10/1/2007 1:10:00 AM | GBP=2.0446 EUR=1.4268Diff= 0.6178 NormDIff = -2.07749124557629
AT 10/1/2007 1:15:00 AM | GBP=2.0446 EUR=1.4271Diff= 0.6175 NormDIff = -2.1391276847069
AT 10/1/2007 1:20:00 AM | GBP=2.0443 EUR=1.4271Diff= 0.6172 NormDIff = -2.15446197586889
See how EURUSD is one bar off?
The print statement was generated with this code.
Print("AT " + Time[0] + " | GBP=" + Open[0] + " EUR=" + diffPairOpen + "Diff= " + priceDifference + " NormDIff = " + ZScore);
Thanks so much.
-Shuli
Comment