Hi ProRealCode-community,
i´m an enthusiastic prt-user and run about 10 to 15 profitable strategies live with my IG-account. I have market experience of about 15 years.
Today I want to show the difference between backtest and live results with this example.
Of course the strategy described in this post is not profitable in real trading.
The reason is that in case of tight stop and take profit values both prices can be triggered within one candle.
The prt-backtest doesn´t know what was first. It will always take the limit. The live system (IG for example) unfortunately not.
Just to be aware of this fact…
Regards,
Somatolysis
… and here is the code …
Feel free to comment.
Happy trading.
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
defparam preloadbars = 5000
defparam cumulateorders = false
//long entry
if not longonmarket and close > average [ 200 ] and time = 090000 then
buy at market
endif
//long exit
if longonmarket and time = 100000 then
sell at market
endif
//short entry
if not shortonmarket and close < average [ 200 ] and time = 090000 then
sellshort at market
endif
//short exit
if shortonmarket and time = 100000 then
exitshort at market
endif
//exit
set stop %loss 0.1
set target %profit 0.1