Hi all,
I have a question. I have started a trading strategy and this is the code:
// Conditions to enter long positions
IF close>open then
BUY 1 CONTRACT AT MARKET
ENDIF
// Conditions to enter short positions
If close<open then
SELLSHORT 1 CONTRACT AT MARKET
ENDIF
// Stops and targets
SET STOP pTRAILING 5
I have started the strategy with broker IG. Now, the strange thing is that there is a big difference between the results of broker IG and backtest prorealtime. Can somebody help me out why there is such a big difference? Attached you will find the results of broker IG and prorealtime.
Thanks in advance
Seems that you don’t test your strategy on the same timeframe? Trades are closed on round hour in the first screenshot and that’s not the case in the second one.
Are you talking about prorealtime CFD?
Yes I’m talking about prorealtime CFD. I have been testing on the same timeframe, that;s just how prorealtime shows backtest closings.
I think you are talking about trading real-time in demo? isn’t it?
If yes, backtest are more efficient because it only deals with condition once per bar, so it doesn’t know at what time your trailing stop occurred, and that’s of course not the case in real-time where stoploss are well executed at correct prices.
Ahhhh, I see, thanks for answering my question, that explains it all.
Case closed 😉
VNParticipant
Average
Hi Nicolas, just wanted to clarify to your response above are you saying that in backtest the trailing stop would be calculated at end of each bar but auto trading mode it would move in real time as the underlying price moves?
That was indeed the case 4 years ago, before PRT add the tick-by-tick backtest engine. The “0 bar issue” is something we don’t talk anymore since years. Always make your backtests with the tick mode option checked.