Wanted: small code snippet for reinvestment

Viewing 9 posts - 61 through 69 (of 69 total)
  • Author
    Posts
  • #59285 quote
    verdi55
    Participant
    Veteran

    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.

     

    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,

    [attachment file=59286]

    DAX-4-Stunden.png DAX-4-Stunden.png
    #59291 quote
    Vonasi
    Moderator
    Master

    Stop loss and target profit are both 1.7 % (percent !)

    Aaaah! Well spotted. I need new glasses as I didn’t see the %! Still how often does the market move 1.7% in 7 seconds? Aaaaah! Just spotted my second error – it is a German screen and an s in German is an h in English!

    #59292 quote
    verdi55
    Participant
    Veteran

    Stop loss and target profit are both 1.7 % (percent !)

    Aaaah! Well spotted. I need new glasses as I didn’t see the %! Still how often does the market move 1.7% in 7 seconds?

    This is on a 4 hour chart, and stops or targets are rarely reached.

    #59294 quote
    Vonasi
    Moderator
    Master

    I’ve just tested it (after putting my glasses on) and it does seem incredible – but so many different indicators for longs and so many totally different indicators for shorts rings alarm bells for curve fitting and also the quarterly graph is a lovely bell curve which also rings alarm bells. I’ll shove it on demo as a ‘fun to watch’ I think.

    [attachment file=59295]

    Screenshot_8.png Screenshot_8.png
    #59297 quote
    verdi55
    Participant
    Veteran

    but so many different indicators for longs and so many totally different indicators for shorts rings alarm bells

     

    I guess that’s the point.

    #59298 quote
    Vonasi
    Moderator
    Master

    I’ll shove it on demo as a ‘fun to watch’ I think.

    No I won’t as the DPO indicator is not allowed in automatic trading.

    #59299 quote
    verdi55
    Participant
    Veteran

    No I won’t as the DPO indicator is not allowed in automatic trading.

    Ahh, so this is another point. DPO is like zig zag, it repaints the past, and cannot be used for trading therefore. So forget about the strategy.

    Detrend Price Oscillator

    #59300 quote
    verdi55
    Participant
    Veteran

    Here you have the comparison with and without DPO. Upper curve is without DPO, everything else the same.

    [attachment file=59301]

    DAX-4-Stunden1.png DAX-4-Stunden1.png
    #59303 quote
    Nicolas
    Keymaster
    Master

    English speaking here please!

    DPO use future datas, that’s why the equity curve looks so good. We all want to know what the future will be like.

    immo_vienna thanked this post
Viewing 9 posts - 61 through 69 (of 69 total)
  • You must be logged in to reply to this topic.

Wanted: small code snippet for reinvestment


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
JohnScher @johnscher Participant
Summary

This topic contains 68 replies,
has 7 voices, and was last updated by Nicolas
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/31/2017
Status: Active
Attachments: 23 files
Logo Logo
Loading...