Nice DAX 30 min algo

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #53657 quote
    Barney
    Participant
    Senior

    A bit more advanced DAX algo(to be me anyway)

    Spread 2p.

    100k=ok

    // Main code : DAX 30 min long
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders=False
    
    indicator1 = ExponentialAverage[22](close)
    indicator2 = ExponentialAverage[22](close)
    c1 = (indicator1 > indicator2[1])
    indicator3 = AroonUp[15]
    indicator4 = Aroondown[15]
    c2 = (indicator3 CROSSES OVER indicator4)
    
    indicator100 = close
    indicator101 = Supertrend[2,11]
    c100 = indicator100 > indicator101
    
    IF c1 AND c2 AND c100 THEN
    BUY 1 CONTRACTs AT MARKET
    ENDIF
    
    SET STOP PLOSS 68
    
    trailingstop = 40
    
    if not onmarket then
    MAXPRICE = 0
    priceexit = 0
    endif
    
    indicator5 = RSI[4](close)
    c5 = (indicator5 <5)
    
    If longonmarket and c5  then
    sell at market
    endif
    
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then
    priceexit = MAXPRICE-trailingstop*pointsize
    endif
    endif
    
    if onmarket and priceexit>0 then
    EXITSHORT AT priceexit STOP
    SELL AT priceexit STOP
    endif
    Juan Salas and Henrik thanked this post
    dax1.jpg dax1.jpg dax2.jpg dax2.jpg
    #53667 quote
    robertogozzi
    Moderator
    Master

    Lines 5-7 can be written:

    indicator1 = ExponentialAverage[22](close)
    //indicator2 = ExponentialAverage[22](close)
    c1 = (indicator1 > indicator1[1])
    #53688 quote
    Nicolas
    Keymaster
    Master

    Barney! Well done. So you have optimized your variables from 100k bars ago to the end of December last year? Is that the thing you want us to understand in your first picture? Is this is true, you have indeed validate this In Sample Period in OOS one, it’s a good thing.

    #53701 quote
    victormork
    Participant
    Veteran
    Well done Barney. The system is a little bit too long in the market for my liking but apart from that it’s good. I made  a few updates, hope it can help you! Lycka till!
    // Main code : DAX 30 min long
    //-------------------------------------------------------------------------
    DEFPARAM CumulateOrders=False
    
    indicator1 = ExponentialAverage[22](close)
    indicator2 = AroonUp[15]
    indicator3 = Aroondown[15]
    indicator4 = Supertrend[2,11]
    indicator5 = RSI[5](close)
    indicator6 = averagetruerange[15]
    
    // LONG
    b1 = (indicator1 > indicator1[3])
    b1 = b1 and (indicator2 CROSSES OVER indicator3)
    b1 = b1 and close > indicator4
    
    be1 = (indicator5 <5)
    
    // ENTRY AND EXIT
    IF b1 THEN
    BUY 1 CONTRACTs AT MARKET
    
    ENDIF
    
    If longonmarket and be1 then
    sell at market
    endif
    
    // Stop and Target
    SET STOP PLOSS (indicator6 * 6.9)*pointsize
    SET TARGET PPROFIT (indicator6 * 13.8)*pointsize
    
    // trailing stop
    trailingstop = (indicator6 * 2.2)*pointsize
    
    if not onmarket then
    MAXPRICE = 0
    priceexit = 0
    endif
    
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then
    priceexit = MAXPRICE-trailingstop*pointsize
    endif
    endif
     
    if onmarket and priceexit>0 then
    EXITSHORT AT priceexit STOP
    SELL AT priceexit STOP
    endif
    
    Skärmavbild-2017-11-23-kl.-11.07.50.png Skärmavbild-2017-11-23-kl.-11.07.50.png
    #53704 quote
    victormork
    Participant
    Veteran
    Btw you can delete line 50.
    #53705 quote
    victormork
    Participant
    Veteran
    Haha sorry! line 49.
    #53706 quote
    Barney
    Participant
    Senior

    Nicolas

    Yes, that´s what i want to show with the first picture.

    Can not test 200k unfortunately. 

    Looks real good on 100k :))

     

    #53712 quote
    Aloysius
    Participant
    Veteran

    Here is the backtest with 200000 bars. The moment where the optimisation begins appears quite clearly.

    Captureprt.jpg Captureprt.jpg
    #53714 quote
    Barney
    Participant
    Senior

    Thanks for 200k Aloysius.

    200k look almost strange, have made an effort to not over optimize this time!

    Ok, before my 100k algo does not loos money :))

    #53716 quote
    jebus89
    Participant
    Master

    I have a question, indeed it looks curve-fitted, but i have noticed that there are different forms of curve-fitting. 

    Example #1: Some systems shows a TERRIBLE negative shitty results going from start of 200K=> 100K backtest.

    Example #2: Others, like this system, shows more or less 0 profit/loss from start of 200K => to where the 100K starts

    Example #3: and then theres the ones that stay profitable. For example i created one system on dax 15m that looked very profitable and good in 100K, then i got premium PRT and 200K, and it looked … OK i would say, from 200K start => 100K start. It was not as good as the 100K backtest, but it was more or less an OK smooth line going up, not as steep or good looking as 100K backtest alone but still profitable and decent.   

    I have personally made every one of these examples 😛

     do not have enough experience in this field to make conclusions, but i would guess that example #1, the terrible looking system should be thrown away right? And obviously the example #3 with profitable EQ curve going from 100K to 200K backtesting, is something that you would keep working on right? But as with this system… what is the correct thing to do? I mean, yes it is clearly curve-fitted, but if you change some of the variables and get a decent curve going from start to finish on 200K backktest, should you just assume that youve just curvefitted it more for bigger data? or might it be something? Should you throw away the idea at once? keep working on it? Anyone got any answers here?? 😀

    #53818 quote
    Nicolas
    Keymaster
    Master

    The 100k bars before are also forming a big OOS period. To get a better picture, a complete WFA should be made, with different scenarios: 3,5,9 or more optimized IS periods and OOS validations.. but at the end it is always up to you to make conclusions and invest money in the strategy or not. There are already many topics where discussions are made about what could be considered as robust or not.

    #53830 quote
    jebus89
    Participant
    Master

    @Nicolas I understand what you mean, and i agree, but do you have an opinion on wether to keep working on it or not, if you have example 1 or 2 in my post over?

    In other words: if u go from 100K backtrst, to 200K backtest, do you need to see profitable trading all the way? Would you throw away the strategy if its very unprofitable in the past?

    #53839 quote
    Nicolas
    Keymaster
    Master

    Example 1: consider it like a negative WFE, so not robust (at least on this period).

    Example 2: so-so WFE should desserve a second guess!  

    #53857 quote
    victormork
    Participant
    Veteran
    @jebus89 I tired this strategy on the Swiss index and it gave a positiv return (obviously not as good as on DAX), so I like to believe there is still something to build on here.
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.

Nice DAX 30 min algo


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Barney @rickardktm Participant
Summary

This topic contains 13 replies,
has 6 voices, and was last updated by victormork
8 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 11/22/2017
Status: Active
Attachments: 4 files
Logo Logo
Loading...