DI TEMA Trendfollowing strategy (on DAX 5 min)

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #100774 quote
    Jan
    Participant
    Veteran

    You are invited to comment on the strategy “DI TEMA Trendfollowing strategy on DAX 5 min”

    Thank you very much in advance for findings, comments, robustness.

    #100789 quote
    AlgoAlex
    Participant
    Master

    Where’s the strategy?

    #100791 quote
    robertogozzi
    Moderator
    Master

    You can find it in the library.

    #100793 quote
    GraHal
    Participant
    Master

    Attached for DAX spread = 2

    Jan-4.jpg Jan-4.jpg Jan-5.jpg Jan-5.jpg
    #100796 quote
    GraHal
    Participant
    Master

    Works even better on DJI 1 min spread = 4

    Jan and reb thanked this post
    Jan-7.jpg Jan-7.jpg Jan-8.jpg Jan-8.jpg
    #103739 quote
    Peter
    Participant
    Average

    Jan,

    thanks for sharing. I played around with time settings but nothing worked.

    My results are attached.

    /Peter

    #105295 quote
    Jesper
    Participant
    Junior

    I’m trying to figure out why leaving out the overnight data makes such a big difference on the outcome as the algo is server side?

    #106633 quote
    kalleklovn
    Participant
    Junior

    I´m using this now with real $ and its working good i use the 30 min chart with settings.

    DEFPARAM CumulateOrders = false // Cumulating positions deactivated
    //VARIABLES
    once SLperc = 105 // Stoploss percentage 105/10000 * Close (150)
    once TrailSLPerc = 60 // Trailng Stoploss percentage 85/10000 * Close 60
    once Tema2 = 10 // Tema setting for opening long/short positions 10
    once DI2 = 7 //DI setting for opening long/short positions 7
    once Duration = 12 // number of bars in trade before reducing the trailing stop 12
    once Factor = 7/10//factor to reduce trailing stoploss after some time in the trade
    
    once StartE = 74500 //start time for opening positions
    once StartL = 103000 //ending time for opening positions (only trading in the morning)
    once N = 1 // initieel aantal contracten
    OTD = Barindex - TradeIndex(2) > IntradayBarIndex // limits the (opening) trades till 1 per day
    #106639 quote
    Vonasi
    Moderator
    Master

    kalleklovn – please use the ‘Insert PRT Code’ button to embed code when posting as it makes it much easier for every one to read. I have tidied up your post for you. 🙂

    kalleklovn thanked this post
    #106642 quote
    kalleklovn
    Participant
    Junior

    Thanks i´m still new and never really been active on any forums 🙂

    #106645 quote
    GraHal
    Participant
    Master

    @kalleklovn thank you for sharing your settings.

    Your share prompted me to look at the 5 min version and I can see that it dropped off in performance after publishing in the library (as so many Systems do).

    As seen from attached the drop off just needs a bit of re-opti to get back on track. I found the variables very  very responsive!

    I’ll try and remember to check the settings regularly! 🙂

    Thank you @Jan Wind for sharing this Strategy with us all.

    EDIT / PS

    The .itf should state DAX (not DJI) … one eye on the TV again, sorry! 🙂

    reb and Curre68 thanked this post
    JanW.jpg JanW.jpg JanW-2.jpg JanW-2.jpg JanW-TEMA-DJI-5M-v2.itf
    #109771 quote
    Jan
    Participant
    Veteran

    Hello GraHal

    “As seen from attached the drop off just needs a bit of re-opti to get back on track. I found the variables very  very responsive!

    I’ll try and remember to check the settings regularly! 🙂 ”

    Do you have any guidelines of re optimizing your auto trading model ? Do you do it every week, and than for 1 year of history for instance ? Or how do you do this ?  Re-optimizing implicitly means that you are assuming that the last data gives the best change of predicting future movements.  Then a very important question is what is “the best” set of data ?

    Kind regards, Jan Wind

    #109775 quote
    Matriciel
    Participant
    Master

    A new strategy for Jan Wind !

    Works on EUR/USD 15 minutes timeframe.

    DEFPARAM CumulateOrders = True
    DEFPARAM PRELOADBARS = 10000
    
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    Horaire = time >= 000000 and time <= 200000
    
    CloturePartielle = 1// 1 = ON, 0 = OFF
    PositionsizeA = 1
    PositionsizeV = 1
    MAXSHARES = abs(COUNTOFPOSITION) <= 19
    
    IF CloturePartielle THEN
    PositionsizeA = 4
    PositionsizeV = 3
    ENDIF
    
    MM = Average[56,3](totalprice)
    
    Newhighest = max(DHigh(0),DHigh(1))
    Newlowest = min(DLow(0),DLow(1))
    
    Milieu = (Newhighest+Newlowest)/2
    Surachat = average[10,4]((Newhighest+Milieu)/2)
    Survente = average[10,4]((Newlowest+Milieu)/2)
    
    CA = (MM > Surachat) and (close crosses over Milieu)
    CV = (MM < Survente) and (close crosses under Milieu)
    
    // Long Entries
    IF Horaire AND CA AND MAXSHARES AND not daysForbiddenEntry AND NOT SHORTONMARKET THEN
    BUY PositionsizeA CONTRACTS AT MARKET
    ENDIF
    
    IF CloturePartielle THEN
    IF LONGONMARKET AND COUNTOFLONGSHARES <= 16 THEN
    SELL 1 CONTRACTS AT TRADEPRICE + 40*pointsize LIMIT
    ENDIF
    
    IF LONGONMARKET AND COUNTOFLONGSHARES <= 4 THEN
    SELL 1 CONTRACTS AT TRADEPRICE + 20*pointsize LIMIT
    ENDIF
    
    IF LONGONMARKET AND COUNTOFLONGSHARES <= 6 THEN
    SELL 1 CONTRACTS AT TRADEPRICE + 18*pointsize LIMIT
    ENDIF
    ENDIF
    
    IF LONGONMARKET AND summation[35](close < close[6]) = 35 THEN
    SELL AT MARKET
    ENDIF
    
    // Short Entries
    IF Horaire AND CV AND MAXSHARES AND not daysForbiddenEntry AND NOT LONGONMARKET THEN
    SELLSHORT PositionsizeV CONTRACTS AT MARKET
    ENDIF
    
    IF CloturePartielle THEN
    IF SHORTONMARKET AND COUNTOFSHORTSHARES <= 20 THEN
    EXITSHORT 1 CONTRACTS AT TRADEPRICE - 78*pointsize LIMIT
    ENDIF
    
    IF SHORTONMARKET AND COUNTOFLONGSHARES <= 1 THEN
    EXITSHORT 1 CONTRACTS AT TRADEPRICE - 40*pointsize LIMIT
    ENDIF
    ENDIF
    
    IF SHORTONMARKET AND summation[32](close > close[6]) = 32 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    //MFE
    //trailing stop
    trailingstop = 33
     
    //resetting variables when no trades are on market
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    priceexit = 0
    endif
     
    //case SHORT order
    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close) //saving the MFE of the current trade
    if tradeprice(1)-MINPRICE>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MINPRICE+trailingstop*pointsize //set the exit price at the MFE + trailing stop price level
    endif
    endif
     
    //case LONG order
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close) //saving the MFE of the current trade
    if MAXPRICE-tradeprice(1)>=trailingstop*pointsize then //if the MFE is higher than the trailingstop then
    priceexit = MAXPRICE-trailingstop*pointsize //set the exit price at the MFE - trailing stop price level
    endif
    endif
     
    //exit on trailing stop price levels
    if onmarket and priceexit>0 then
    EXITSHORT AT priceexit STOP
    SELL AT priceexit STOP
    endif
    
    //SET TARGET pPROFIT 46
    SET STOP pLOSS 200
    Jan thanked this post
    #109831 quote
    GraHal
    Participant
    Master

    Thank you for your excellent work @Matriciel, but as it is a different strategy than this Topic (DI TEMA) would it not be better posted as a separate topic then the Community can easier discuss / comment / improve your strategy?

    Not that it needs much improving! 🙂

    I reduced to 1 Lot for easier comparison to other Systems, but we can’t do Fwd Test anyway with a strategy that Sells / ExitShort on partial Lot size (as your code does)… it has to be for example Sell at ….

    I have enabled tick by tick mode! 🙂

    mat.jpg mat.jpg mat-2.jpg mat-2.jpg
    #109880 quote
    Matriciel
    Participant
    Master
    Hi Grahal,
    I know this is not the place for this strategy but it was Jan Wind who asked me because I have problems to copy / paste in the subject concerned.
Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.

DI TEMA Trendfollowing strategy (on DAX 5 min)


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Jan @janwd Participant
Summary

This topic contains 18 replies,
has 2 voices, and was last updated by nonetheless
4 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 06/15/2019
Status: Active
Attachments: 10 files
Logo Logo
Loading...