WARNING! IG Backtests are currently wrong!
Forums › ProRealTime English forum › ProRealTime platform support › WARNING! IG Backtests are currently wrong!
- This topic has 18 replies, 5 voices, and was last updated 7 years ago by JC_Bywan.
-
-
01/14/2017 at 7:43 PM #21125
Hi all!
Please look at the attached screenshot of a 20 day simple moving average trading system.
1234567891011121314151617DEFPARAM CumulateOrders = Falseindicator1 = closeindicator2 = Average[20](close)c1 = (indicator1 CROSSES OVER indicator2)IF c1 THENBUY 1 CONTRACT AT MARKETENDIFindicator3 = closeindicator4 = Average[20](close)c2 = (indicator3 CROSSES UNDER indicator4)IF c2 THENSELL AT MARKETENDIFI wasted my complete sunny saturday morning trying to fix a coding error until I turned really exhausted, frustrated and angry.
So, if you are reading this:
Use your weekend to the fullest and don’t waste it like I did!
Enjoy yourselves.
01/14/2017 at 7:59 PM #2113301/14/2017 at 8:20 PM #2113701/14/2017 at 8:23 PM #2113801/15/2017 at 9:25 AM #2115101/15/2017 at 11:32 AM #21156Hello Nicolas,
that is what I am saying: “Backtests are currently wrong”.
Both screenshots are from backtests. And I am also 100% sure that the code is correct. Especially since the results from the Prorealtime PRT are the way they should be.
My partner has issued a ticket to IG and I will post the reply here.
01/15/2017 at 12:30 PM #2115901/15/2017 at 1:22 PM #21163Seems like there is a problem with the “Cross over/under” function in backtest.
After reading this post I explained a similar error here.
Edit: Despite the rant- was it an actually explanation you were given- about the bug fix?
Cheers Kasper
01/15/2017 at 6:20 PM #21188I Think it could be possible that it is right.
At your first picture it open at 22 and close at 13, open at 19 an close at 24 …
so this is right I think, but I didn´t understand why the system is open a position: Close = the line with green and red, Average = blue?!
01/15/2017 at 6:50 PM #2119101/15/2017 at 7:12 PM #21195@Kasper: There is no response from IG, yet. I think I was more angry at myself then anything else. This observation does big damage to my belief that the backtested results are correct and/or the indicators are represented correct on the chart. I have noticed things like this before but always chose to go the easy way. I mean I told myseld “It’s just a temporary bug that will be fixed very soon.”.
01/15/2017 at 7:18 PM #2119601/15/2017 at 7:20 PM #2119701/15/2017 at 7:22 PM #21198@Derek, I think this is a great opportunity to address the problem, not with IG, but have it escalated to Prorealtime. You have an obvious error that is so clear and simple that it cannot be denied.
Cheers Kasper
01/15/2017 at 7:50 PM #21199Hi,
Maybe the problem here is different from the one I encoutered last November, but just in case it could be the same, I’ll mention it anyway:
I also found a problem with a buy order in a backtest I did back in November and in this case I narrowed it down to a stochastic value being different from expected. Just to be 100% sure it wasn’t my code I then made a simple test “outside” of my code, looking at that stochastic value in probuilder, and running a dummy probacktest only calculating and displaying the same stochastic via Graph. I found some differences between the probuilder stochastic and the probacktest stochastic, I talked about it with Nicolas (who guessed correctly what the problem was going to be) on the PRC french forum, and also sent my tests results to PRT sincerely thinking I found a bug.
The answer from PRT surprised me: it was because my chosen settings was “not displaying weekend data”, but the backtests are always “using weekend data” (those few ticks sunday night on CFD’s…). So on one hand I was happy to see there was neither a problem with my code nor a PRT bug creating calculations errors strictly speaking, but on the other hand, I was not so pleased to discover that if I choose not to display weekend data, that choice works only for my indicators in probuilder but it is not applied to my backtests running on PRT server side…
This means that depending on the chosen timeframe and indicators used in my code, anything needing to look back in the past earlier than first candle monday morning, could end up with a different value than expected for things like a stochastic (in case extremes affecting it are made on a sunday). And very likely will be different for things like ema’s and macd’s that would use sunday data instead of friday’s…
Again, I am not saying the same thing happened with your MA20 I haven’t tested it, I’m just saying what I discovered, in case the same thing applies here (which can be tested if you choose to display weekend data in the PRT timezone options)
3 users thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on