I've been backtesting my strategy for a while now, and it keep giving me impossible exit prices on certain trades resulting in unrealistic results. Here is a screen capture of a EURNZD trade from 09/26 which supposedly exited on the 09/29 at a price of 1.6116. Unfortunately there wasnt a price even near that level. The low of that 4-hour candle on 09/29 was 1.6313.
The 1.6116 price was the closing day low of 09/26.
The 1.6313 price was the closing day low of 09/29.
My strategy is programmed so that all trades are closed at the end of the day. I use a Add(PeriodType.Day,1) in the Initialize() section for this. And then I check if(BarsInProgress == 1) { exitlong(); exitshort(); return; }
For some reason the Strategy Analyzer thinks that it can close the 09/29 trade for the price of the 09/26 day close.
So I wonder why the Strategy Analyzer gives me this result? There is some serious errors going on in the handling of bars and prices.
Comment