Discussing Matriciel EURUSD Dhigh Dlow

Viewing 15 posts - 61 through 75 (of 119 total)
  • Author
    Posts
  • #118239 quote
    Matriciel
    Participant
    Master

    Check this out – by splitting into 2 strategies for long and short then re-optimizing each individually gives an extra 60% gain with combined win rate of 97% (4 losses out of 122).

    More trades, more wins, lower drawdown, better best trade, better average gain, better gain/loss.

    Left hand image is the combined strategy, based on Paul’s EURCAD-DhighDlow-v1p position size =1

     

    Hi guys,
    It is true that the gains are better by optimizing each strategy, long and short. However, limited risk accounts do not allow two opposite positions to be opened simultaneously as this can happen by putting these two strategies on the market.
    #118246 quote
    nonetheless
    Participant
    Master

    limited risk accounts do not allow two opposite positions

    Yes, that is something to be aware of. But in that case I would be inclined to run this one long-only – almost the same return with 98% wins.

    I’m on a standard account so it’s not a problem. I’ve been reviewing all my algos that run both ways and in every case they’re better off split. To me this makes total sense, as each one then has one task instead of two and is sure to be more efficient.

    #118253 quote
    Matriciel
    Participant
    Master

    Why not… 🙂

    #118254 quote
    BobFlynn
    Participant
    Senior

    @Nonetheless,

     

    Can you share your optimized .itf files ?

    Thank you,

    #118257 quote
    nonetheless
    Participant
    Master

    I just greyed out the relevant long / short details from each then optimized the trend and period variables. I did this over the whole 100k with no WF so you might want to look at it again, but the basic code is so good I didn’t feel that another WF was necessary. Would probably need further adjustments if looking back 200k…

    My version also has money management which was off during the tests. If you want to enable it, change line 10 to MM2ndType = 1

    Many thanks to Matriciel and Paul and everyone else for this excellent piece of work!

    Matriciel, Paul and GraHal thanked this post
    EURCAD-15m-DhighDlow-short.itf EURCAD-15m-DhighDlow-long.itf
    #118376 quote
    bertrandpinoy
    Participant
    Veteran

    la version ITF du dernier code est elle qq part?

    #118402 quote
    Vonasi
    Moderator
    Master

    bertrandpinoy – English only in the English speaking forums please. 🙂

    #119479 quote
    Vonasi
    Moderator
    Master

    bertrandpinoy – Please stop posting in French in the English speaking forums. I have deleted your last post – please re-post in English or open a topic in the French forum if you wish to communicate in French.

    #119914 quote
    redfoxspacewolf
    Participant
    Junior

    Why does this strage use 2 moving averages? I have modified it use only one single MA and it works quite beautifully too.

    31 wins and 4 losses over pass 10000 periods of 30 mins.

    3.88 gain/loss

     

     

    DEFPARAM CumulateOrders = False
    DEFPARAM PRELOADBARS = 10000
    
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
    
    Schedule = time >= 000000 and time <= 220000
    
    PositionsizeA = 3
    PositionsizeV = 3
    
    MM = Average[135](totalprice)
    
    Newhighest=max(DHigh(0), DHigh(1))
    Newlowest=min(DLow(0), DLow(1))
    
    Middle = (Newhighest+Newlowest)/2
    Overbought = average[150]((Newhighest+Middle)/2)
    Oversold = average[150]((Newlowest+Middle)/2)
    
    CA = (MM > Overbought) and (close crosses over Middle)
    CV = (MM < Oversold) and (close crosses under Middle)
    
    // Long Entries
    IF Schedule AND CA AND not daysForbiddenEntry AND NOT SHORTONMARKET THEN
    BUY PositionsizeA CONTRACTS AT MARKET
    ENDIF
    
    IF LONGONMARKET THEN
    SELL AT TRADEPRICE +50*pointsize LIMIT
    ENDIF
    
    // Short Entries
    IF Schedule AND CV AND not daysForbiddenEntry AND NOT LONGONMARKET THEN
    SELLSHORT PositionsizeV CONTRACTS AT MARKET
    ENDIF
    
    
    IF SHORTONMARKET THEN
    EXITSHORT AT TRADEPRICE - 50*pointsize LIMIT
    ENDIF
    
    //MFE
    //trailing stop
    trailingstop = 40
     
    //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 100
    
    Detailed-Report.jpg Detailed-Report.jpg
    #119950 quote
    Francesco
    Participant
    Veteran

    OOS is very bad on GBPJPY @redfoxspacewolf

    #119955 quote
    redfoxspacewolf
    Participant
    Junior

    @Francesco

    What is OOS?

    #119956 quote
    nonetheless
    Participant
    Master

    OOS = out of sample. You optimized for 10,000 bars but if you run it on 100,000, or even 20,000 it fails – sorry!

    #119957 quote
    redfoxspacewolf
    Participant
    Junior

    Do you recommend that I run a 100000 period test for it to fit better? I have executed the system and it was profitable in the last 7 trades

    #119960 quote
    Vonasi
    Moderator
    Master

    Do you recommend that I run a 100000 period test for it to fit better?

    All you are then doing is curve fitting it to all the data available. Best practice is to develop a strategy on part of the data available (which is your in sample test) and then test it on the rest of the data available once you have finished the strategy – this is your OOS test. If the strategy is good then it should perform the same or close on the the OOS data. If it flops then it is a sure sign that you just fitted it to your IS data – so bin it and start again. Never be tempted to tweak a failed strategy so that it works on all the data as you are just curve fitting it to all your data and then have no way to check if it is curve fitted except forward testing it on future data.

    Your 7 winning trades is a good forward test so far but as a data sample it is tiny and not to be trusted. Leave it running on live demo for a few years before committing any real money to it would be my suggestion.

    #119962 quote
    nonetheless
    Participant
    Master

    More data gives a bigger picture, but you have to do a Walk Forward analysis to check the performance in and out of sample. There’s a chapter in the manual that’ll show you how to do that.

    (Posted before i saw Vonasi’s reply)

Viewing 15 posts - 61 through 75 (of 119 total)
  • You must be logged in to reply to this topic.

Discussing Matriciel EURUSD Dhigh Dlow


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
BobFlynn @bobflynn Participant
Summary

This topic contains 118 replies,
has 33 voices, and was last updated by nonetheless
5 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 12/05/2019
Status: Active
Attachments: 55 files
Logo Logo
Loading...