Automated system vs Backtest
Forums › ProRealTime English forum › ProOrder support › Automated system vs Backtest
- This topic has 9 replies, 3 voices, and was last updated 2 years ago by
PeterSt.
-
-
12/30/2022 at 7:17 PM #206550
Dear All,
I have just started for the first time ever an auto trading strategy. It’s been running for about a week and the results are largely in line with expectations I have from backtesting using PRC.
However, today the System (live, automated) did not generate the same trades as the backtest. The code is identical – I run a backtest with the code from the System. I cannot understand why the two would differ, so I wonder what I have missed and if anyone else has encountered such a conundrum. Aggravatingly the System did not profit today whereas the backtest says today was quite good. This is not an execution or timing problem – the System was not short when the Backtest was.
Many thanks for reading and for any guidance you may have.
Happy New Year,
Rufus
12/30/2022 at 8:02 PM #206552Don’t get disheartened, it happens to all of us, it could be one of a whole host of reasons …
https://www.prorealcode.com/topic/real-trading-does-not-match-the-backtest/#post-175189
1 user thanked author for this post.
12/30/2022 at 8:13 PM #206554Thanks GraHal, Not disheartened, more frustrated… great link for me to explore, thank you.
My suspicions are this reason:
- Starting a strategy at a different time (1 hour or even 1 minute later): depending on the code of the strategy, the results of some calculations could be different.
The IG server thing is a worry, but the system was short and then closed by a PRC instruction which the backtest does not show… so it points to the above. I will check.
1 user thanked author for this post.
12/30/2022 at 8:29 PM #20655512/30/2022 at 9:54 PM #206558same start date and time for the backtest
Same as what? Same date and time as the System started in Live ProOrder?
And did the exact same System in Live ProOrder take any trades?12/30/2022 at 10:48 PM #20656012/31/2022 at 6:25 AM #206565Hi Rufus,
You can not let start the backtest at the exact same time as the first trade you saw occurring in Live (or Demo-Live). Instead you must start the backtest so much in advance as the system requires to grab the same trade.
Now that was confusing … 🙂
Your system will work with averages and you need to give it the time to “develop”. Is that 100 bars ? then start the system 100 bars (e.g. minutes – that depends on your TimeFrame) earlier than the first trade occurring in Live. In general it requires a bit of wiggling to get it done, but once you got the hang of that, it will be easy a next time.
Once that first trade is synchronised, the remaining trades should too. If they don’t, then it’s your turn to sort out the why of it.1 user thanked author for this post.
12/31/2022 at 9:28 AM #206567Peter you may have your wires crossed 😉 (or I may have?) … I assumed that Rufus had changed the start date &time of backtest to read same as the date&time shown on the version running Live on Proorder?
now identical start time made none
What value spread did you input to the backtest engine and what Instrument are you testing on?
1 user thanked author for this post.
12/31/2022 at 1:34 PM #206573I think you may have nailed the issue with spread. Spread size has made a difference to how short the backtest was at the time in question, although it was short nonetheless whereas the live system closed the short. So it looks like the spread may have widened at that point in real life. This would be consistent with the lower liquidity present at this time of year and explains why this hasn’t happened before. Thanks v much.
1 user thanked author for this post.
12/31/2022 at 3:12 PM #206576@GraHal, always having my wires crossed … and in that case I read too fast (I somehow read that it was about the start of the trade in Live; and mind you on the longer term this is never about having the backtest starting at the same time of the Live system because it is always about individual trades which may not be in sync. Thus for example, if the first trade would have been OK and the next one not (synced), then what ?)
I better use those wires to fire some fireworks tonight !
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on