Difference in live trading and simulation
Forums › ProRealTime English forum › ProOrder support › Difference in live trading and simulation
- This topic has 8 replies, 4 voices, and was last updated 7 years ago by Joachim Nilsson.
-
-
02/02/2017 at 2:07 PM #23601
Hi,
I am fairly new at this, so I just made a simple MA crossover to start with. The results were great so I took in live yesterday.
This morning the algorithm took its first position, which was a loss of 11,4 points. But when simulating (or back-testing) the algorithm now, ProOrder indicates that the trade was a profit of 8,7 points. Please see the attached screenshots.
The spread trough IG is 2 points, so that should be the issue.
Can anyone please explain this?
Thanks in advance!
Tobias
02/02/2017 at 2:21 PM #23608Have you added spread in your backtest? Have you tested it with PRT v10.3 (tick by tick)? Have you become a victim of the “0 bars issue”?
02/02/2017 at 2:22 PM #2360902/02/2017 at 2:55 PM #23622Hi,
The code is found below.
I use PRT 10.2, so I haven’t checked the tick by tick back-test.
The spread is included in the simulations. What is the “0 bars issue”? Perhaps that could be it since it closed on the same candle.
12345678910111213141516171819202122232425262728293031323334353637383940// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM FlatBefore = 071500DEFPARAM FlatAfter = 215500indicator1 = Average[34](close)indicator2 = Average[36](close)NoC = CurrentMonth - 1 //Adjust for February//indicator3 = Stochastic[14,3](close)// Conditions to enter long positionsc1 = (indicator1 CROSSES OVER indicator2)IF c1 THENBUY NoC CONTRACT AT MARKETENDIF// Conditions to exit long positionsc2 = (indicator1 CROSSES UNDER indicator2)IF c2 THENSELL AT MARKETENDIF// Conditions to enter short positionsc3 = (indicator1 CROSSES UNDER indicator2)IF c3 THENSELLSHORT NoC CONTRACT AT MARKETENDIF// Conditions to exit short positionsc4 = (indicator1 CROSSES OVER indicator1)IF c4 THENEXITSHORT AT MARKETENDIF// Stops and targetsSET STOP pTRAILING 2I know it looks weird with the narrow span on the MA’s and tight stop loss, but since the results were great, I couldn’t resist trying it live.
Cheers,
Tobias
02/02/2017 at 4:20 PM #23631You’ll find many topics about the “0 bars” issues around here. Since version 10.3, prorealtime embed a new backtest engine that solve this behaviour of the way trades were considered if the target and stoploss price levels were in the same bar.
I made a video about it: https://www.prorealcode.com/blog/video-tutorials/tick-tick-backtest-engine-probacktest/
02/02/2017 at 8:14 PM #2368702/02/2017 at 8:30 PM #23690If you´re trading DAX I think the smallest possible trailing stop you can use is 5points
02/03/2017 at 9:38 AM #23746Hi,
Thanks for your replies. I thought the trailing stop at 2 points seemed funny, but that was the result I got when optimizing it. I’ll adjust it and try again.
Henrik, do you have any explanation for why the stop is 10p instead of 2p?
So basically, the backtest can’t be trusted in PRT 10.2 without tick by tick backtest?
Tobias
02/03/2017 at 1:09 PM #23774You can´t even trust v10.3 tick by tick backtest but it´s better than 10.2
-
AuthorPosts
Find exclusive trading pro-tools on