Backtest vs Live – Different Results Recently??
Forums › ProRealTime English forum › ProRealTime platform support › Backtest vs Live – Different Results Recently??
- This topic has 6 replies, 4 voices, and was last updated 4 weeks ago by GraHal.
-
-
11/20/2024 at 12:16 PM #240577
Peformance of one of my Algo’s had dropped off recently under Demo Live running, so I thought I’d check the variables for optimum.
Spent about 20 mins checking everything out, even did a check on https://www.diffchecker.com/text-compare/.
Also, as a double check, I copied & pasted the code from the Demo Live Algo and backtested that exact same code.Results are:
1. 1st image shows results since 21 Oct 24 on Demo Live.
2. 2nd image shows results since 21 Oct 24 on Demo Backtest.
It’s as if the data (from 21 Oct to 31 Oct) available to Backtest is not the same as the data which was available while the Algo was running in Demo Live??
Give it a try / test over the same dates to see if you get similar differences please?
11/20/2024 at 1:57 PM #24058011/20/2024 at 3:01 PM #240587the “spread” in demo live differs from the backtest…
I agree … spread in Demo Live will be same (?) as Real Live … 4.8 UK overnight, 3.6 UK daytime with 2.4 during USA market open hours.
I use a spread of 5 in Demo Backtest if the strategy takes orders overnight; I use a spread of 4 if no overnight orders taken.
I have not noticed such a marked difference between Backtest and Live with my other Algo of the same overall strategy.
I’ll check a few other Algo’s when I get chance.
Thanks for taking a look and your comments JS.
1 user thanked author for this post.
11/21/2024 at 1:12 PM #24062111/21/2024 at 3:52 PM #240630Hi GraHal
Not done any tests but, if the code is executed sequentially and, both long and short trades can be taken, if long is first and exits, then the following short may be taken from the same bar.
Not sure that this would happen the other way around, short second, short exit, next bar before long can be taken, long taken from next bar. In general this may not be a problem, however under certain scenarios does it happen!
If trades get out of sequence, for unknown reason, then some trades may not exit, stopping others form entering and vice versa creating a knock on affect.
This is just speculation and doesn’t negate any other issues regarding live and demo.
From the charts, it looks like the first trade may have been the same, however soon deviate which may be a later exit of trade. Its hard to say without zooming in and comparing etc.
I would identify where the trades first started to deviate, and how that happened and affected the following trade(s), early/late exit or entry.
By being in a trade it shouldn’t have been in, and depending on whether it was long or short may give the out of sequence situation.
Also the entry/exit condition(s) may not be true in the later different bar location.
From the deviation point you could compare the live entry/exit with the demo to see what they had to do differently, to get the two different outcomes.
Comparing the equity charts, initially, the price is going short, the demo equity follows the price down but the live doesn’t and enters/exits trades to gain equity. This looks like both doing something consistently opposite.
When price starts to go long, both equity curves appear similar and stay similar even though different number of trades taken.
There could be a couple of things happening,
1. the initial unknown deviation( which may repeat ),
2. the knock on affects of 1.
3.maybe the sequence of code execution depending on the trades and which came first etc.
4. something else!,
5. A difference in spread to cause a entry/exit difference.
A test could be, to split the long and short trades to different files and see if same taken comparing demo to demo split and original live.
Also you could start demo to run at different places where no trade should have been running to see if the trades it does take from then on are the same as demo/live.
This to see if unknown deviation re-curs., or normal trades taken if ignore earlier deviation.
Another way of looking at this is to work out what has to happen to get the demo trades to mimic the live trades and vice versa. May be theirs a correlation between data collected between trades that were not affected by preceding trade.
Anyway, just a few thoughts.
If you can post the detailed reports, Order list and Closed position list, for both I’ll take a look and see if I can see something. They don’t have to cover all the trades but from the posted beginning would be ideal.
Going on a tangent, can you post a link to the post where you did the algo 7day trial, I’ve looked several times but failed to find it.
regards
1 user thanked author for this post.
11/21/2024 at 9:11 PM #240637Anyway, just a few thoughts.
Wow! You’re not kidding!! Excellent thoughts and ideas for me to try / test out!
Big Thank You for being So Helpful once again druby .7day trial
I guess you mean these?
https://www.prorealcode.com/topic/vendor-compare-performance/page/2/#post-238093
https://www.prorealcode.com/topic/vendor-compare-performance/page/3/#post-2381801 user thanked author for this post.
11/22/2024 at 1:22 PM #240653My code reverses direction in the same bar (unless a TS executes exit) so I added
If ‘ShortCond’ Then Sell at Market Endif and vice versa.
I was expecting there to be a difference in trades / equity / results, but none jumped out at me.start demo to run at different places where no trade should have been running
Ha, an easy test to do and it worked!!
It appears that the System stoppages in Real Live in my OP ss went in my favour! Most of the Stoppages were at 12:00 / midday, see red vertical lines in OP ss. There is often a spike in DJI at midday, so no surpise re Stoppages, but annoying all the same.
Anyway, I started the Demo Live at the green vertical line (Wed 23 Oct at 14:00) and the rest of the equity on Demo Live looks near enough same as Real Live … allowing for the other few Stoppages indicated by red vertical lines.
- 1st image is Demo Live.
- 2nd image is Real Live.
This Topic shows that System Stoppages can sometimes work in our favour, be nice to think it works out as ‘swings and roundabouts’?
‘Gold Star’ and Big Thanks go to druby for sharing ‘Thoughts for Investigation’ … without which I may not have pursued the problem and been left thinking Demo Live results are not reliable!
1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on