Forums › ProRealTime English forum › ProOrder support › Not setting a spread on a backtest. › Reply To: Not setting a spread on a backtest.
01/24/2019 at 9:13 AM
#89531
Yep there’s a difference. 🙂 Have a look at these pics. And also the code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
DefParam FlatBefore = 090000 DefParam FlatAfter = 130000 Defparam cumulateorders=false xClose = (Open+High+Low+Close)/4 if(barindex>2) then xOpen = (xOpen[1] + xClose[1])/2 endif c1 = xClose>xOpen AND xClose[1]<xOpen[1] c2 = xClose<xOpen AND xClose[1]>xOpen[1] if c1 AND Not LongOnMarket then BUY 1 SHARE AT MARKET EXITSHORT AT MARKET endif if c2 AND Not ShortOnMarket then SELLSHORT 1 SHARE AT MARKET SELL AT MARKET Endif SET STOP $LOSS 95 SET TARGET $PROFIT 85 |
The first pic shows a backtest with 1 pip spread on the DAX. Stop loss 95, limit 85. The second pic shows the same system but with stop loss 96 and limit 84. I always get better results when I don’t define the spread. Any idea how there can be a difference between these two?