Forums › ProRealTime English forum › ProOrder support › Programmed Daylight Savings Time Change Code Block › Reply To: Programmed Daylight Savings Time Change Code Block
I came up with a reasonable solution
1 |
IF ( dayofweek >= 0 and month = 3 AND 31-day<7 ) OR ( month = 10 AND 31-day > 6 ) OR (dayofweek = 4 AND month = 10 AND day<31) OR (dayofweek = 3 AND month = 10 AND day+1<31) OR (dayofweek = 2 AND month = 10 AND day+2<31) OR (dayofweek = 1 AND month = 10 AND day+3<31) OR (dayofweek = 0 AND month = 10 AND day+4<31) OR (dayofweek = 5 AND month = 10 AND 31-day<7) THEN |
I also remembered it’s possible to use currentdayofweek which should produce the same results and it does for most parts. However when I run a backtest for AUDUSD h1 22K for some reason a comparison of the 2 reports shows there’s difference in results. I compare the list of trades in a spreadsheet (here as a web page and as spreadsheet) and all the trades are the same they match but the statistics are not the same?
Then I increase to 100K bars and scanning through the trades visually I find an erroneous trades on:
- Sunday 27 October 2002 at 20:00
- Sunday 1 November 2003 at 20:00
- etc…
- and the good thing about this error is that it doesn trade at the start of the Sunday when the market opens but I guess its delaying the trade.
Also, when you look at the candles and the spreadsheet sometimes trades close every hour but other times they do not and they close on the following hour with 2 units closing/exiting.
Is there an error with the backtest engine?