Forums › ProRealTime English forum › ProOrder support › Wanted: small code snippet for reinvestment › Reply To: Wanted: small code snippet for reinvestment
01/12/2018 at 8:33 PM
#59285
I stripped this of everything that does not appear to be necessary (no seasonal stuff, no order cumulation, position size always = 1), and the results still look almost to good to be true. Backtest done in tick-by-tick mode.
probably not the holy grail
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 |
defparam flatafter = 210000 defparam flatbefore = 090000 cx1 = cci[11]<80 cx2 = cci[21]>-90 cx3 = Momentum[6](close)>0 cx6 = TR(close) >25 cx8 = EaseOfMovement[14]<95 cx9 = SmoothedStochastic[14,3](close)<95 cx10 = PriceOscillator[5,25](close)<0.5 cx11 = LinearRegressionSlope[10](close)>-14 cx12 = AccumDistr(close)>-0.1 cx13 = Chandle [20](close)>-51 cx15 = DPO[21](close)>-50 cx16 = DPO[21](close)<50 IF cx1 and cx8 and cx9 and cx10 and cx12 and cx15 and close < ExponentialAverage[8](close) and (not shortonmarket) Then sellshort 1 CONTRACTS AT MARKET ENDIF IF cx2 and cx3 and cx6 and cx11 and cx13 and cx16 and close > ExponentialAverage[8](close) and (not longonmarket) Then buy 1 CONTRACT AT MARKET ENDIF Set Stop %Loss 1.7 Set Target %profit 1.7 |
So, probably it is just a matter of overfitting, because so many different parameters and conditions are used. Stop loss and target profit are both 1.7 % (percent !), so I don’t see a problem here. Short average duration of positions may be a problem, but I am not sure,