COWABUNGA on Dax with Multiple Time Frames

Viewing 15 posts - 1 through 15 (of 21 total)
  • Author
    Posts
  • #76333 quote
    robertogozzi
    Moderator
    Master

    There is the strategy, based on https://www.babypips.com/trading/so_youve_finished_the_school_o, I changed:

    • 10-minute TF instead of 15
    • SL and TP are fixed numbers, instead of being set at a swing price or the like
    • added a sort of trailing stop to lock some profits

    It seems to perform nicely (june 1st through today), even though I did not go through Walk Forward.

    edit:     this code is missing TIMEFRAME(default) after line 37, see the correct version (code and ITF file) at
    https://www.prorealcode.com/topic/cowabunga-on-dax-with-multiple-time-frames/page/2/#post-147088

    //************************************************************************
    //                              Cowabunga DAX
    //
    //    https://www.babypips.com/trading/so_youve_finished_the_school_o
    //************************************************************************
    //
    DEFPARAM CumulateOrders = False                            //Do not cumulate orders
    DEFPARAM FlatBefore     = 090000                           //No Trades before 09:00
    DEFPARAM FlatAfter      = 200000                           //No Trades after  21:00
    DEFPARAM PreLoadBars    = 2000
    ////////////////////////////////////////////////////////////////////////
    TIMEFRAME (10 minutes, updateonclose)                      //10 minutes instead of 15
    ONCE nLots              = 1
    ONCE TP                 = 65                               //65
    ONCE SL                 = 50                               //50
    ONCE AvgType            = 1                                //1 = ema
    ONCE FastMA             = 5                                //5
    ONCE SlowMA             = 10                               //10
    FastMA15m               = Average[FastMA,AvgType](close)
    SlowMA15m               = Average[SlowMA,AvgType](close)
    ONCE StocOS             = 25                               //25 - 75  OverSold/OverBought tresholds
    ONCE StocOB             = 100 - StocOS
    StocK15m                = Stochastic[10,3](close)          //10, 3
    StocD15m                = Average[3](StocK15m)             //3
    ONCE RsiMiddle          = 50                               //50
    ONCE RsiP               = 9                                //9
    Rsi15m                  = Rsi[RsiP](close)
    Macd15m                 = MACD[12,26,9](close)             //12,26,9
    ////////////////////////////////////////////////////////////////////////
    TIMEFRAME (4 hours, updateonclose)                         //4 hours (240 minutes)
    FastMA4h                = Average[FastMA,AvgType](close)
    SlowMA4h                = Average[SlowMA,AvgType](close)
    
    StocK4h                 = Stochastic[10,3](close)          //10, 3
    StocD4h                 = Average[3](StocK4h)              //3
    
    Rsi4h                   = Rsi[RsiP](close)
    //************************************************************************
    //                           LONG  trades
    //************************************************************************
    a0 = FastMA4h > SlowMA4h                            //FastMA > SlowMA            on higher TF
    a1 = FastMA15m CROSSES OVER SlowMA15m               //FastMA crosses over SlowMA on lower  TF
    a2 = Rsi4h > RsiMiddle                              //Rsi > Middle line on higher TF
    a3 = Rsi15m > RsiMiddle                             //Rsi > Middle line on lower  TF
    a4 = StocD4h > StocOS                               //D > OS on higher TF
    a5 = StocK4h > StocD4h                              //K > D on higher TF
    a6 = StocD15m > StocOS                              //D > OS on lower TF
    a7 = StocK15m > StocD15m                            //K > D on lower TF
    a8 = StocK4h < StocOB                               //K < OB on higher TF
    a9 = Macd15m > Macd15m[1]                           //Macd increasing on lower TF
    ax = a0 AND a1 AND a2 AND a3 AND a4 AND a5 AND a6 AND a7 AND a8 AND a9
    IF ax AND Not OnMarket THEN
    SET TARGET pPROFIT TP
    SET STOP   pLOSS   SL
    BUY nLots CONTRACT AT MARKET
    ENDIF
    //************************************************************************
    //                           SHORT trades
    //************************************************************************
    b0 = FastMA4h < SlowMA4h                            //FastMA < SlowMA             on higher TF
    b1 = FastMA15m CROSSES UNDER SlowMA15m              //FastMA crosses under SlowMA on lower  TF
    b2 = Rsi4h < RsiMiddle                              //Rsi < Middle line on higher TF
    b3 = Rsi15m < RsiMiddle                             //Rsi < Middle line on lower  TF
    b4 = StocD4h < StocOB                               //D < OB on higher TF
    b5 = StocK4h < StocD4h                              //K < D on higher TF
    b6 = StocD15m < StocOB                              //D < OB on lower TF
    b7 = StocK15m < StocD15m                            //K < D on lower TF
    b8 = StocK4h > StocOS                               //K > OS on higher TF
    b9 = Macd15m < Macd15m[1]                           //Macd decreasing on lower TF
    bx = b0 AND b1 AND b2 AND b3 AND b4 AND b5 AND b6 AND b7 AND b8 AND b9
    IF bx AND Not Onmarket THEN
    SET TARGET pPROFIT TP
    SET STOP   pLOSS   SL
    SELLSHORT nLots CONTRACT AT MARKET
    ENDIF
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    TIMEFRAME (default)        //code to lock some profits
    //////////////////////////////////////////////////////////////////////////////////////////////////////////
    ONCE TrailStart    = 15        //15     Start trailing profits from this point
    ONCE ProfitPerCent = 0.400     //40.0%  Profit to keep
    IF Not OnMarket THEN
    y1 = 0
    y2 = 0
    ELSIF LongOnMarket AND close > (TradePrice + (y1 * pipsize)) THEN                         //LONG
    x1 = (close - tradeprice) / pipsize              //convert price to pips
    IF x1 >= TrailStart THEN                         //go ahead only if N+ pips
    y1 = max(x1 * ProfitPerCent, y1)              //y = % of max profit
    ENDIF
    IF y1 THEN                                       //Place pending STOP order when y>0
    SELL AT Tradeprice + (y1 * pipsize) STOP      //convert pips to price
    ENDIF
    ELSIF ShortOnMarket AND close < (TradePrice - (y2 * pipsize)) THEN                        //SHORT
    x2 = (tradeprice - close) / pipsize              //convert price to pips
    IF x2 >= TrailStart THEN                         //go ahead only if N+ pips
    y2 = max(x2 * ProfitPerCent, y2)              //y = % of max profit
    ENDIF
    IF y2 THEN                                       //Place pending STOP order when y>0
    EXITSHORT AT Tradeprice - (y2 * pipsize) STOP //convert pips to price
    ENDIF
    ENDIF
    immo_vienna, Berra, GraHal and 3 others thanked this post
    #76336 quote
    immo_vienna
    Participant
    Average

    great work!

    Kovit thanked this post
    #76340 quote
    immo_vienna
    Participant
    Average

    tryin to make an MoneyManagement-System for it 😀

    #77105 quote
    GraHal
    Participant
    Master
    Just had this System stopped with the message below. No entry in the Orders List under Cancelled / Rejected. Never had this message before, anybody had it or know what it means? Wished I’d taken a screen shot.

    Strategy Forced Stop 

    #77107 quote
    Vonasi
    Moderator
    Master
    Never had this message before, anybody had it or know what it means?
    Nope – but I would send a report especially as it is an MTF strategy and any issues need to be reported so we can get MFT on live sooner rather than later fully tested.
    #77108 quote
    GraHal
    Participant
    Master
    Done! Tech Report sent! Thanks for the prompt! 🙂
    #77109 quote
    robertogozzi
    Moderator
    Master
    Share their answer!
    #105564 quote
    robertogozzi
    Moderator
    Master
    Any answer GraHal?
    #105609 quote
    GraHal
    Participant
    Master
    Any answer GraHal?
    Usual problem … even if I had an acknowledgement from PRT for the Tech Report they rarely quote any information from the Tech Report (or didn’t used to) and so I have no copy of what I sent as the Tech Report. I just spent 15 mins doing an e-search of my email account linked to my Platform (and 3 other email accounts) and I cannot find anything relating to the Issue / error message – “Strategy Forced Stop” and also “forced stop”. So I am sorry, but I have no reply / information to share. Why anyway … have you had the same error message recently??
    #105613 quote
    robertogozzi
    Moderator
    Master
    I never happened to see that message!
    GraHal thanked this post
    #105619 quote
    GraHal
    Participant
    Master
    I’ve changed Timeframes (only) and set it going on Demo Forward Test on Dax. I’ll report back if System gets rejected
    #105640 quote
    GraHal
    Participant
    Master
    Cowabunga System has executed 3 trades this morning with no rejections! Hopefully that rejection reason  / error I experienced over 12 months ago is gone for good!?
    #105641 quote
    robertogozzi
    Moderator
    Master
    I think so, last June/July Nicolas reported that many issues between PRT and IG had been resolved, hopefully!
    #105642 quote
    winnie37
    Participant
    Veteran
    whenn i backtest it on dax1€ / 10 minutes, i have these results…Not really the same ratio Robertgozzi gave. I did an error somewhere? No results on 1 min..
    #105645 quote
    robertogozzi
    Moderator
    Master
    Mine was just over 40 days, yours is much longer. Any strategy’s settings should be updated regularly. Once a month, I’d recommend. If you plan to use settings so that it runs smoothly over one o more years then you’ll average down your profits, but you won’t spend much effort on it. If, instead, you aim to larger profits then you’ll have to update settings often, backtesting for shorter periods. This will imply more efforts, though.
    winnie37 thanked this post
Viewing 15 posts - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.

COWABUNGA on Dax with Multiple Time Frames


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 20 replies,
has 7 voices, and was last updated by robertogozzi
5 years, 3 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/19/2018
Status: Active
Attachments: 5 files
Logo Logo
Loading...