EURUSD daily strategy

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #62173 quote
    Francesco78
    Participant
    Master

    eurusd strategy that works for very long time on daily TF.

    Walk forward parameters:

    rangemin

    pr

    period

    No walk forward on seasonality parameters. (day and month forbidden)

    //-------------------------------------------------------------------------
    // Main code : eurusd_TF_daily
    //-------------------------------------------------------------------------
    DEFPARAM cumulateOrders = False // Cumulating positions deactivated
    ///parameter definition
    //inputs
    rangemin = 3
    pr = 170
    period = 10
    dayforbiddenlong =4
    dayforbiddenshort = 2
    monthforbiddenlong =1
    monthforbiddenshort =4
    
    //variables
    mav = average[period](close)
    oscillator = close-mav
    rossa =  (Dclose(0)-Dopen(0))<0
    verde = (Dclose(0)-Dopen(0))>0
    rangetoday = abs(Dclose(0)-Dopen(0))
    
    //entry condition
    
    cl = oscillator > 0
    cl = cl and rossa
    cl = cl and rangetoday > rangemin
    cl = cl and dayofweek <> dayforbiddenlong and month <> monthforbiddenlong
    
    
    cs = oscillator<0
    cs  =cs and verde
    cs = cs and rangetoday > rangemin
    cs = cs and dayofweek <> dayforbiddenshort and month <> monthforbiddenshort
    
    IF cl THEN
    buy 1 PERPOINT AT MARKET
    ENDIF
    
    if cs then
    sellshort 1 perpoint at market
    endif
    
    //exit condition
    set target pprofit pr
    
    prorealcodeeurusddbt-1518209912l8p4c.png prorealcodeeurusddbt-1518209912l8p4c.png prorealcode_eurusd_wf_d1-1.png prorealcode_eurusd_wf_d1-1.png prorealcode_eurusd_d1_stat.png prorealcode_eurusd_d1_stat.png
    #62426 quote
    Nicolas
    Keymaster
    Master

    Hi Francesco! Been a long time since your last post 🙂 Thanks a lot for this new automatic trading idea.

    I get almost the same result as you, but I need to understand something for a better comprehension, what is rangemin? Is is in pips? is it 3 or 30 pips?

    With a PRT-CFD account, EURUSD is 5 decimals, so I guess we must adapt this value to the correct pip size?

    I made this modification:

    //-------------------------------------------------------------------------
    // Main code : eurusd_TF_daily
    //-------------------------------------------------------------------------
    DEFPARAM cumulateOrders = False // Cumulating positions deactivated
    ///parameter definition
    //inputs
    rangemin = 30
    pr = 170
    period = 10
    dayforbiddenlong =4
    dayforbiddenshort = 2
    monthforbiddenlong =1
    monthforbiddenshort =4
    
    //variables
    mav = average[period](close)
    oscillator = close-mav
    rossa =  (Dclose(0)-Dopen(0))<0
    verde = (Dclose(0)-Dopen(0))>0
    rangetoday = abs(Dclose(0)-Dopen(0))
    
    //entry condition
    
    cl = oscillator > 0
    cl = cl and rossa
    cl = cl and rangetoday > rangemin*pipsize
    cl = cl and dayofweek <> dayforbiddenlong and month <> monthforbiddenlong
    
    
    cs = oscillator<0
    cs  =cs and verde
    cs = cs and rangetoday > rangemin*pipsize
    cs = cs and dayofweek <> dayforbiddenshort and month <> monthforbiddenshort
    
    IF cl THEN
    buy 1 PERPOINT AT MARKET
    ENDIF
    
    if cs then
    sellshort 1 perpoint at market
    endif
    
    //exit condition
    set target pprofit pr
    

    Below is the test with 30 pips.

    eurusd-daily-automatic-trading-strategy.png eurusd-daily-automatic-trading-strategy.png
    #62431 quote
    Francesco78
    Participant
    Master

    Hi Nicolas,

    I see  your point, yes It should be 30 pips indeed, I have it quoted 12264.5-12265.0 and 3 is a variation of 3 of your 4th decimal digit.

    I have uk account, pls see if with GMT it is more similar..

    Many thanks!

    Francesco

    #62441 quote
    T-rader
    Participant
    Average

    Hi Francesco

    I took the liberty to optimize your code on IG prt eur/usd.
    I also added a stop loss. A big chunk of the profit disappeared but the draw down is down 60%. I optimized it from year 2000 until today. Before is oos.

    DEFPARAM cumulateOrders = False // Cumulating positions deactivated
    ///parameter definition
    //inputs
    rangemin = 5
    pr = 70
    pl = 80
    period = 7
    dayforbiddenlong =4
    dayforbiddenshort = 2
    monthforbiddenlong =1
    monthforbiddenshort =4
     
    //variables
    mav = average[period](close)
    oscillator = close-mav
    rossa =  (Dclose(0)-Dopen(0))<0
    verde = (Dclose(0)-Dopen(0))>0
    rangetoday = abs(Dclose(0)-Dopen(0))
     
    //entry condition
     
    cl = oscillator > 0
    cl = cl and rossa
    cl = cl and rangetoday > rangemin*pipsize
    cl = cl and dayofweek <> dayforbiddenlong and month <> monthforbiddenlong
     
     
    cs = oscillator<0
    cs  =cs and verde
    cs = cs and rangetoday > rangemin*pipsize
    cs = cs and dayofweek <> dayforbiddenshort and month <> monthforbiddenshort
     
    IF cl THEN
    buy 1 PERPOINT AT MARKET
    ENDIF
     
    if cs then
    sellshort 1 perpoint at market
    endif
     
    //exit condition
    set target pprofit pr
    set stop ploss pl
    
    Nicolas thanked this post
    Skärmklipp27.png Skärmklipp27.png
    #62444 quote
    Nicolas
    Keymaster
    Master

    @T-rader Cool, but that’s a range filter of about only 5 pips on a daily timeframe 🙂 What difference without it?  I got almost the same result as you, but without the tick by tick option.

    Below is the result I have with the tick backtest and a spread of 2 pips. Timezone is UTC 0 (default forex timezone).

    Francesco78 thanked this post
    automatic-trading-eurusd.png automatic-trading-eurusd.png
    #62449 quote
    Francesco78
    Participant
    Master

    Tick to tick shouldnt matter right? we dont have stop and profit on the same candle. yes I agree its a bit weird to have e pips filter.You can set it to zero but the results will be worst. The point of this strategy is that is working since 1980.

     

    .

    #62452 quote
    T-rader
    Participant
    Average

    I might have been a little bit quick there. I tested it with 1p spread but now with 2p spread the differens between tick by tick and not tick by tick is a bit bigger…

    Skärmklipp.png Skärmklipp.png
    #62457 quote
    Nicolas
    Keymaster
    Master

    Tick to tick shouldnt matter right? we dont have stop and profit on the same candle.

    Why? I got many “zero bars orders” in the orders list.

    #62460 quote
    Francesco78
    Participant
    Master

    Tick to tick shouldnt matter right? we dont have stop and profit on the same candle.

    Why? I got many “zero bars orders” in the orders list.

    Yep you are right, Im writing a version that have no zero bars. Posting soon

    Nicolas thanked this post
    #62462 quote
    Francesco78
    Participant
    Master

    voila’, I got rid of 2 parameters (rangemin and pr ), no zero bars now

     

    //-------------------------------------------------------------------------
    // Main code : eurusd_TF_daily
    //-------------------------------------------------------------------------
    DEFPARAM cumulateOrders = False // Cumulating positions deactivated
    ///parameter definition
    //inputs
    period = 7
    dayforbiddenlong =4
    dayforbiddenshort = 2
    monthforbiddenlong =1
    monthforbiddenshort =4
     
    //variables
    mav = average[period](close)
    oscillator = close-mav
    rossa =  (Dclose(0)-Dopen(0))<0
    verde = (Dclose(0)-Dopen(0))>0
    
     
    //entry condition
     
    cl = oscillator > 0
    cl = cl and rossa
    cl = cl and dayofweek <> dayforbiddenlong and month <> monthforbiddenlong
     
     
    cs = oscillator<0
    cs  =cs and verde
    cs = cs and dayofweek <> dayforbiddenshort and month <> monthforbiddenshort
    
    
     
    IF cl  THEN
    buy 1 PERPOINT AT MARKET
    ENDIF
     
    if cs  then
    sellshort 1 perpoint at market
    endif
    
    nozerobars.png nozerobars.png eurusd_v2.png eurusd_v2.png
    #62477 quote
    T-rader
    Participant
    Average

    Well done!

    The dd is too big for me personally but the code looks great.

    #62485 quote
    Nicolas
    Keymaster
    Master

    Thanks Francesco,  so in this version  you don’t afford to loose until a new contrarian signal?

    #62507 quote
    Francesco78
    Participant
    Master

    yes Nicolas, that is the case.

    #62558 quote
    Francesco78
    Participant
    Master

    Nicolas do oyu think we can post this last version in the library?

    Thank you

    #62560 quote
    Nicolas
    Keymaster
    Master

    yes Nicolas, that is the case.

    Ok, so that explain the large drawdown.

    Nicolas do oyu think we can post this last version in the library?

    Yes, just after a quick review 😉

    Francesco78 thanked this post
Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.

EURUSD daily strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 15 replies,
has 4 voices, and was last updated by Vonasi
8 years ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/12/2018
Status: Active
Attachments: 9 files
Logo Logo
Loading...