EURUSD 15-minutes timeframe Dhigh / Dlow Strategy

EURUSD 15-minutes timeframe Dhigh / Dlow Strategy

Hello everyone,

I wanted to share with you a strategy that works on the EUR / USD instrument in 15 minutes timeframe.
I have set up a partial position closure but unfortunately it still does not work in real time.

There is something that is problematic for me, some positions last very long time on the market and pay attention to overnight charges!

Good trades!

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

New! PRC is also now on YouTube, subscribe to our channel for exclusive content and tutorials

  1. Finning • 107 days ago #

    I don’t have enough bars to properly backtest on, but I’m getting 100% win rate out of this without tweaking with 3:1 runup to drawdown. Works with 10 minutes too. A great strategy!!

  2. Mags67 • 106 days ago #

    Thanks, looks to be a great system but ProOrder cannot handle orders that partially closes positions. Can this be changed and still maintain your idea?

  3. Matriciel • 106 days ago #

    @ Finning
    Indeed, I did not notice that the system worked in 10 minutes but the drawdown is much more important.

    @ Mags67
    You can enable or disable the partial closing position.
    – To activate the partial closure of position: CloturePartielle = 1 (On)
    – To deactivate the partial closure of position: CloturePartielle = 0 (Off)

  4. snowmei • 106 days ago #

    Matriciel,

    It was amazing, 100% winning trades! Thanks for sharing! I suppose you have applied it – just wonder if it works in real the same way? of course apart from slippage.

    Also would like to ask a question about trailing stop as a newbie, wonder if you could help me out. Auto trade I set stop as 30P and trailing stop 10p, a sell order sent in (in demo) last night 6pm, overnight the price had gone down 50p and then pulled up 55p the order still open. Also I noticed the stop is actually 10p on the order. Just confused how exactly these stops works on prorealtime. Thanks!

  5. Matriciel • 106 days ago #

    @ snowmei

    I did not apply this robot in real because the positions remain too long on the market, in my opinion.
    About trailing stop, it is better that you ask ProRealTime or Nicolas to explain their operations.

    • snowmei • 106 days ago #

      Why don’t you close all the position before the market close then re-access the situation and open a trade next morning?
      IF time = 210000 THEN
      SELL AT MARKET
      EXITSHORT AT MARKET
      ENDIF

      BTW I am new to the site, how to ask Nicolas?

  6. Matriciel • 106 days ago #

    The variable “Schedule” is not mandatory. It does not change much. I integrated it into the robot because the module “Walk Forward” finds a very slight increase in earnings.

    Nicolas is the webmaster of this website.

  7. Gregg • 105 days ago #

    Hi Matriciel, thanks for your share.
    I backtested the strategy with 10000€ from january 2017 to june 2019, great results !!! But in February 2018 I have a loss of 8000€ ! So dangerous if it happens the first month you launch the strategy don’t you think?

  8. Matriciel • 105 days ago #

    Yes indeed.
    You have to test this strategy in demo mode for a while before launching it in real life to see if it is doing well.
    This strategy is to improve, all remarks is good to take! 🙂

  9. agamennone m • 104 days ago #

    hi,i’m new about this,somebody can explain me how does this strategy works?
    thanks

  10. luigiR • 96 days ago #

    hi, can you explane how to try to launch with pro order?
    good job

  11. ricky1028 • 52 days ago #

    hI, I’m a beginner of ProRealTime, when i try to launch automatic trading, it pops up the message below.
    “Trading systems with orders that partially close a position cannot be sent to ProOrder (ex: SELL SHARES AT MARKET). Make sure that no quantity is specified in instructions to close positions (in this case, the instruction closes the entire position). Ex:
    SELL AT MARKET
    EXITSHORT AT 1.5 LIMIT”

    Could you please advise the possible solution for code modification? Many thanks!!

    • Gubben • 47 days ago #

      Apparently there is no support for partial closing. If you want to modify to be viable, remove the parts of the code with “CloturePartielle”.

  12. jmf125 • 31 days ago #

    Thank you for sharing I backtested this strategy from May to Sept 2019 ( max I have) on 15 mins time frame EUR/USD – And ends up 10,180 ???
    What is the time frame you have in the posting ?

  13. Jan Wind • 20 days ago #

    Hallo Matriciel,
    Thanks for the code.
    I was playing around, and trying to simplify some of your code:
    I changed your code:
    Newhighest=0
    FOR a = 0 TO 1 DO
    IF DHigh(a)>Newhighest or Newhighest=0 THEN
    Newhighest = DHigh(a)
    ENDIF
    NEXT

    Newlowest=0
    FOR b = 0 TO 1 DO
    IF DLow(b)<Newlowest or Newlowest=0 THEN
    Newlowest = DLow(b)
    ENDIF
    NEXT

    to a (I thought) easier code (see below), but that gives interesting differences : more gross profit, but time to market increases significanty, which is costly : for the Eur/USD for 10 minutes timeframe. I need to investigate further, but I just want to let you know.

    Newhighest=max(DHigh(0), DHigh(1))

    Newlowest=max(DLow(0), DLow(1))

  14. Jan Wind • 20 days ago #

    Hallo Matriciel,

    After short investigation, just to let you know:

    Newhighest=max(DHigh(0), DHigh(1))
    Newlowest=min(DLow(0), DLow(1))

    is much shorter and is exactly the same as your code below: (as you use only two periods to compare)

    Newhighest=0
    FOR a = 0 TO 1 DO
    IF DHigh(a)>Newhighest or Newhighest=0 THEN
    Newhighest = DHigh(a)
    ENDIF
    NEXT

    Newlowest=0
    FOR b = 0 TO 1 DO
    IF DLow(b)<Newlowest or Newlowest=0 THEN
    Newlowest = DLow(b)
    ENDIF
    NEXT

  15. Matriciel • 19 days ago #

    Hello Jan Wind,
    Indeed, it’s the same thing.
    Thanks for the simplification.

  16. Jan Wind • 19 days ago #

    Goodmorning Matriciel

    Partial closing is a problem with PRT as it does not like more than one limit or more than one stop at the same time (in one bar), as far as I understand .

    Presumably you have thought about it, but would SEQUENTIAL CLOSING helps you out as a form of partial closing which will work ?
    (I will test myself later, it is a bit different concept, interesting to test what those results are.)

    Coded for example like this:
    IF CloturePartielle THEN
    IF LONGONMARKET THEN
    IF countoflongshares = 4 then
    SELL 1 CONTRACTS AT TRADEPRICE + 18*pointsize LIMIT
    else
    IF countoflongshares = 3 then
    SELL 1 CONTRACTS AT TRADEPRICE + 20*pointsize LIMIT
    else
    IF countoflongshares = 2 then
    SELL 1 CONTRACTS AT TRADEPRICE + 40*pointsize LIMIT
    else
    IF countoflongshares = 1 then
    SELL 1 CONTRACTS AT TRADEPRICE + 40*pointsize LIMIT
    endif
    ENDIF
    ENDIF
    endif
    endif
    endif

  17. Matriciel • 19 days ago #

    Hi Jan Wind,
    You give me an idea.
    This is a new version.
    Always in 15 minutes timeframe.
    Be careful to drawdown !

  18. Matriciel • 19 days ago #

    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) 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 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

  19. Jan Wind • 19 days ago #

    I will test your new code, thanks for sharing.

    Why do you use DEFPARAM PRELOADBARS = 10000 ? You do not use long period averages, that should be calculated at the first bar, as far as I understand.

    Are there currency trades in the weekend ? For indices you do not need the code below.
    daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0

  20. Jan Wind • 19 days ago #

    The new code you added gives errors when copying it into PRT, at line 11 MAXSHARES = abs(COUNTOFPOSITION) Surachat) and (close crosses over Milieu)

    It happens (sometimes) when you paste PRT code into the textboxes here.

  21. Matriciel • 18 days ago #

    Sorry for the copy / paste. The button “Insert PRT code” does not work.
    You are right, the “DEFPARAM PRELOADBARS = 10000” is not used in this code. I kept it by habit that serves me in other bots. As for “daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0”, I put it for security.
    I will try to deliver the new code.

  22. Matriciel • 18 days ago #

    That’s the missing part of the code.
    From line 11 to 28.

    MAXSHARES = abs(COUNTOFPOSITION) Surachat) and (close crosses over Milieu)
    CV = (MM < Survente) and (close crosses under Milieu)

  23. Matriciel • 18 days ago #

    Decidedly, it really does not work copy / paste! 🙁

  24. Jan Wind • 17 days ago #

    It will help if you open a new Discussion Topic on the forum, not sure how to do it exactly (I can not remember how I did it last time),.

    If you do not know how to open a new one, could you please add it to my opened topic at https://www.prorealcode.com/topic/di-tema-trendfollowing-strategy-on-dax-5-min/

    You can add your new code using the button “PRT code” in the grey fat line above at the right side !
    Thanks in advance !

  25. josef1604 • 15 days ago #

    Keep giving error. Can you hang the code with the * .itf file? Thank you

  26. RICHI71 • 10 days ago #

    a workaround could be run parallel systems that buy 1 contract each and then sell at different levels

  27. Matriciel • 9 days ago #

    Yes why not. We must work on this solution …

  28. BobFlynn • 2 hours ago #

    Hi Matriciel ! Super code ! Did you managed to update your new code somewhere ? I wonder which character gets removed in “abs(COUNTOFPOSITION)*Surachat)” ? Probably un petit “/” slash ? Haha. Good job anyway !

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
juanj DId some tests using MACD validations on higher timeframes using MTF functionality and unfor...
FREDNC Hi Francesco I tried with :
FREDNC adx[14]>adxmin and adx[14] > adxr[14] and adx[14]>adxmin and adx[14] DIminus[3](clo...
Maik2404 es sind leider nur long Positionen und keine Short zu erkennen.
Maik2404 Vytautas: es bleibt aber nur bei long Auslösungen
ullle73 this one is not a winner, have backtested it on almost all pairs, does not have an edge
Jan Wind Hi Francesco Just a question, how do you deal with interest costs of your broker, do you in...
Jan Wind Hi Francesco, and where do you get the information of non trading months and non trading da...
Francesco78 Jan Wind, I obtain it from the backtest
Wilko In answer to SAM: The Logic of the cover clause containing the same logic as the entry-claus...
JanWd Tried the code, nice concept, seems to work quit well for US/EUR 2hrs, Other markets seems n...
JR1976 Simple and nice code , congrats !!! Seems work well with TIme frame 1 h
juanj The last fractal will be coordinate 1 and the high/low of the candle that generates an angle...
juanj And the point of violation is the close of the candle that violates the line by generating a...
juanj For the latest version of the strategy or to follow updates and developments see the thread ...
poonsl2828 Hi! Francesco I have test it on GBP/USD but it only have a trade on 9 Jun which i backtes...
ullle73 why not use 1h chart? has 95% hitrate
ullle73 i see most of positions are only 1 pip before exit?
imokdesign Hi Everybody, when I look at the strategy I felt the need to implement a Moneymanagement-Sy...
Inertia newlevel then multiplier=multiplier+1 oldlevel=newlevel newlevel=strategyprofit+startequi...
Inertia Hi Bjoern, I was playing around with your code this morning (EUR/USD 5'). Thank you to the...
victormork Hi, I would just like to share my own take on this strategy. I'm using 30 min on EURUSD but ...
mckubik Thanks. I will run a Test. 
poonsl2828 Hi! bjoern May i know what timing should i change for time zone (Singapore (GMT +8:00) ...
Kris75 @Ale Hi Ale, Thanks for this rocking algo ;-) there is though a counter performance in 201...
Kris75 Sorry here is my question: >> how can we explain this and correct it?
Samitha Prasanna Hi ALE, would you be able to provide the values for the below part of the code (time >=1...
Dimi.A Awesome mate.
mora87 Hi David and Nicola, I'd like to share idea with you guys which is related to David's Idea. ...
Nicolas Please ask for custom coding in forums instead.
Naren Yanan what is    diplus  diminus  please
Barney Has anyone tested this algon now when PRT 10.3 was released?
Yngve does anyone know if the issue with the TP/SL is resolved ?
JakeDB Answered my own question....Sorry about this question. 5 positions, take profit at 15, loss ...
maxxb sto facendo girare in demo questa strategia modificata a 10 minuti con stop e profit ottimiz...
Manuel9z Hello, this strategy improves with the SL 30 and the TP 10. I have done backtesting and it w...
miguel33 Grazie filippo. sto facendo dei backtest per valutare meglio in diverse situazioni. se tro...
DerPat Hello, If you google, you will find a lot of articles and block posts that clearly show expe...
jens_kittner I would like to inform you that these strategies tested till today (03.05.2019) generates en...
GraHal I adjusted for GMT (minus 1 hour on all times) ... no trades. Might it be because the code ...
GraHal Ooops got that excited I sent that last one twice! ha (and can't delete it, sorry) I got it...
Eric n = 3  dont forget to allow 3 contract in proorder
Doctrading Hello, Someone asked me something (his results seemed to be different) on my email, but it ...
Glen Marquis Not your best..So what is your best strategy? :)
Doctrading It works on ProRealTime CFD, but backtest begins since May 2014
alex224 Hola Andres, buen trabajo. Algun problema por usar la estrategia con acciones en time frame ...
Andres Hola Alex, no lo he probado en otros timeframes, pero con esta configuración específica no c...
Francesco78 does anyone still use this strategy? Seems like it doesnt work anymore
GraHal Hi Francesco78   doesn't work as in not great results? I was just going to give it another g...
GraHal Works good on the DAX @ 30 Sec TF over 100,000 bars ... maybe everything has speeded up by a...
verdi55 At least there should be some moving average that has also reverted into the opposite direct...
verdi55 In addition to the moving average, wait until at least one bar is completely back inside the...
rama This works excellent on range bound I tried , give 90% win rates on dax , 3 min chart. can s...
Doctrading Bonjour, Tu as raison, il faut faire attention à la fiabilité de certains backtests. Le pro...
Duccio Hi DocTrading, I've backtested your strategy and I notice that 75% of position have been cl...
Doctrading Hello,  No, I don't use this strategy on real account, because my own strategies (that you ...

Top