Fractal breakout intraday Strategy EUR/USD 1H

Fractal breakout intraday Strategy EUR/USD 1H

This automated trading strategy is about the breakout of Bill Williams fractals levels. It works well with EUR/USD pair on 1 hour time frame.
The following variables can be optimized:

Period of fractal level: CP= 110 to 114

Trailing Stop long: TGL = 5 to 15

Trailing Stop Short: TGS= 5 to 15

Stop loss by Donchian channel: DC = 15 to 30

Take profit : TP= 15 to 80

The concept of the strategy it’s universal, and It could work for equity/indices/currencies, with all time frame above 15 m

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?

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

  1. Elsborgtrading • 04/15/2017 #

    Again a nice code from you ALE.. *thumbs up*
    Cheers Kasper

    • ALE • 04/15/2017 #

      Happy to hear from your experience!Thanks Kasper

  2. Marcot18 • 04/15/2017 #

    DAVVERO UN OTTIMO CODICE!
    COMPLIMENTI

    • ALE • 04/15/2017 #

      Grazie, provate ad usarlo anche su altri strumenti ottimizzando i parametri

  3. Elsborgtrading • 04/15/2017 #

    I took just a quick look. I think it will take some time to fully understand the traling stop loss, but as always I really like to have defined a fixed stop loss. I don’t know why the plain set stop loss don’t work for eurusd so I came up with this.
    It is just a suggestion so I’d like to hear your thoughts on it.
     
    //EURUSD(-) – IG MARKET
    // TIME FRAME 1H
    // PROBACKTEST TICK by TICK – 200.000 bars
    // SPREAD 0.6 PIP
    // ALE

    DEFPARAM CumulateOrders = false

    Reinvest=1
    if reinvest then
    Capital = 10000
    Risk = 1//0.1//in % pr position
    StopLoss = 48
    REM Calculate contracts
    equity = Capital + StrategyProfit
    maxrisk = round(equity*(Risk/100))
    MAXpositionsize=5000
    MINpositionsize=1
    Positionsize= MAX(MINpositionsize,MIN(MAXpositionsize,abs(round((maxrisk/StopLoss)))))//*Pointsize))))
    else
    Positionsize=1
    StopLoss = 48
    Endif

    ///BILL WILLIAM FRACTAL INDICATOR
    //CP=PERIOD
    CP=113
    if close[cp] >= highest[2*cp+1](close) then
    LH = 1
    else
    LH=0
    endif
    if close[cp] <= lowest[2*cp+1](close) then
    LL= -1
    else
    LL=0
    endif
    if LH=1 then
    HIL = close[cp]
    endif
    if LL = -1 then
    LOL=close[cp]
    endif
    // RETURN, HIL COLOURED(0,200,0) AS “BREAKOUT LEVEL LONG”,HIL COLOURED(200,0,0) AS “BREAKOUT LEVEL SHORT”

    //LONG and SHORT CONDITIONS
    //Positionsize=1
    if (time >=100000 and time < 230000) then
    C1 = (close CROSSES OVER HIL)
    D1 = (close CROSSES UNDER LOL)
    IF c1 and not shortonmarket THEN
    BUY positionsize CONTRACT AT MARKET
    ENDIF

    IF D1 and not longonmarket THEN
    SELLSHORT positionsize CONTRACT AT MARKET
    ENDIF
    ENDIF

    //TRAILING STOP
    TGL =5
    TGS=5
    if not onmarket then
    MAXPRICE = 0
    MINPRICE = close
    PREZZOUSCITA = 0
    ENDIF
    if longonmarket then
    MAXPRICE = MAX(MAXPRICE,close)
    if MAXPRICE-tradeprice(1)>=TGL*pointsize then
    PREZZOUSCITA = MAXPRICE-TGL*pointsize
    ENDIF
    ENDIF
    if shortonmarket then
    MINPRICE = MIN(MINPRICE,close)
    if tradeprice(1)-MINPRICE>=TGS*pointsize then
    PREZZOUSCITA = MINPRICE+TGS*pointsize
    ENDIF
    ENDIF
    if onmarket and PREZZOUSCITA>0 then
    EXITSHORT AT PREZZOUSCITA STOP
    SELL AT PREZZOUSCITA STOP
    ENDIF

    // DONCHIAN STOP
    DC=20
    e= Highest[DC](high)
    f=Lowest[DC](low)
    if longonmarket then
    laststop = f[1]
    endif
    if shortonmarket then
    laststop = e[1]
    endif
    if onmarket then
    sell at laststop stop
    exitshort at laststop stop
    endif

    set target pprofit 30
    set stop loss stoploss*pointsize

    • ALE • 04/15/2017 #

      The trailing stop start if close > tgl or close < tgs and move candles after candles.The second stop loss  is donchian channel level.During my prockbatest I’ve seen that a stop loss above 40 pip works well also. I’m happy to see that your reinvestment code have a good equity in this strategy.I’ve started demo last week, results are only in probacktest, but the code is easy and i’ve already tested trailing stop in real, with other strategies and it work well.I like this strategy because:Low risk, low drawdown since 1998, in the walk farward results are well balanced, the donchian level stop loss it’s a correct interpretation of stop loss after a breakout, and the breakout level are confirmed by long candles in many cases, obviously we cannot discuss Bill William fractal level 
      I’m worried to know if this code works in real time well. We have to wait

    • ALE • 04/15/2017 #

      Kasper your peace of code for reinvestment it’s excellence!

    • ALE • 04/15/2017 #

      piece 😛

    • Frytconcord • 04/15/2017 #

      Bonjour j’ai testé votre code, vraiment impressionnant. J’ai envie de le tester en reel. Ma question est comment inclure ou juste savoir le coût du stoploss ? Car j’ai un compte CFD risque limité. Merci de votre réponse. Et merci pour ce code.

  4. zilliq • 04/15/2017 #

    Thanks Ale,
    Did you try do do a Walk forward with it ?
    Zilliq

    • ALE • 04/15/2017 #

      you can see walk f.  picture above, it’s result with the original parameters 

  5. ALE • 04/15/2017 #

    Yes zilliq

  6. Paris • 04/15/2017 #

    maybe it is a good  idea to open a thread ….

  7. zilliq • 04/15/2017 #

    And the results are ?
    Thanks Ale

    • ALE • 04/15/2017 #

      Zilliq I don’t know if I’ve attached picture

    • Nicolas • 04/15/2017 #

      I have done walk forward myself with 200k bars, real ticks with 10 OOS periods and the results were nice, even with a larger spread than Ale mentioned. I kept the screenshots somewhere, maybe Ale could open a thread to discuss about it, good idea Paris! I think this one could be adapted to other Forex pairs also. 

  8. ALE • 04/15/2017 #

    @ Parisyes good Idea!

    • zilliq • 04/15/2017 #

      Thanks Ale

    • Nicolas • 04/15/2017 #

      Please use the new forum thread about this strategy to post picture: https://www.prorealcode.com/topic/fractal-breakout-intraday-strategy-eurusd-1h/

    • Frytconcord • 04/15/2017 #

      Hello Have you tested this code in real?
      Fractal breakout intraday Stratégie EUR / USD 1H

  9. Paris • 04/15/2017 #

    Sorry guys but i have not the same results at all .
    Does anybody have the same equity curve ? 

    • ALE • 04/15/2017 #

      Eur/usd 1 h – spread 0.6

    • Paris • 04/15/2017 #

      In fact i have the dame , just my back test is a little shorter i only have 85 000 candles . Maybe i  have an idéal to improve your back test , why ont to add a lot each 1000€ won . What do y ou think . I can give you a little snippet that do that .

  10. Paris • 04/15/2017 #

    In fact i have the same , just my back test is a little shorter i only have 85 000 candles . Maybe i  have an idéal to improve your back test , why not to add a contract each 1000€ won . What do y ou think . I can give you a little snippet that do that

    • ALE • 04/15/2017 #

      yes of course.. Have you seen Kasper’s code above?

  11. Paris • 04/15/2017 #

    OK mine is more simpler but does pretty thé same 

  12. ALE • 04/15/2017 #

    I’ve open a new topic here: https://www.prorealcode.com/topic/fractal-breakout-intraday-strategy-eurusd-1h/

  13. Francesco78 • 04/15/2017 #

    Thank you Ale, great code

  14. Paris • 04/15/2017 #

    snippet for modulation of contract 
    n = 1+(ROUND((strategyprofit)/7500))
    every 7500 € it adds a contract …. of course you cuold modify it 

    • ALE • 04/15/2017 #

      Thanks Paris

  15. criscolci • 04/15/2017 #

    Bella lì Ale!! Sei il n*1

  16. iramirez55 • 04/15/2017 #

    Bonita estrategia. Gracias ALE

    • ALE • 04/15/2017 #

      … thanks I hope could help our community!

  17. WimF • 04/15/2017 #

    It help me a lot.  Excellent id “Merci”

    • ALE • 04/15/2017 #

      🙂 Wim Thank you!

  18. GDKLockout • 04/15/2017 #

    Hi, Im new to this forum and automated trading, so please excuse the nooby question:
    If you have a trailing stop active why is the losses so high? $443 average loss??

    • ALE • 04/15/2017 #

      Hello
      because this trailing stop start next candles if condition is verified. 
      For more informations please use relative topic, don’t hesitate to ask more informations.

  19. ALE • 04/15/2017 #

    I have added the last version in the forum
    https://www.prorealcode.com/topic/fractal-breakout-intraday-strategy-eurusd-1h/

  20. Nicolas Pierre Louis • 04/15/2017 #

    Hello Ale,

    What do you think of ? :
    cp = 115
    tgl = 1
    tgs = 25

    have a good day

    Nico

    • ALE • 04/15/2017 #

      why do you want to works the trading system with a trailing stop long of 1 point and the trailing stop short of 25 points?

  21. Nicolas Pierre Louis • 04/15/2017 #

    oh yes I forgot : dc = 18 🙂

  22. supermyguel • 04/15/2017 #

    Ciao ALE. Recentemente sono passato a ProRealTime da VisualTrader e sto cercando di imparare la programmazione….. Sto studiando il tu Trading System con le modifiche di Elsborgtrading. Chiedevo per favore se potevi spiegrami perchè ci sono giorni interi in cui il sistema non entra in posizione e cosa significano queste due righe di codice “Capital = 10000” e “MAXpositionsize=5000
    MINpositionsize=1”. Grazie

  23. Kris75 • 04/15/2017 #

    @Ale
    Hi Ale,
    Thanks for this rocking algo 😉 there is though a counter performance in 2018 and it seems it is after HIL and LOL crossed as normaly HIL is strictly > LOL; I whish I could insert an image but it is not possible on comments section;
    very best,
    Chris

  24. Kris75 • 04/15/2017 #

    Sorry here is my question: >> how can we explain this and correct it?

  25. Samitha Prasanna • 04/15/2017 #

    Hi ALE, would you be able to provide the values for the below part of the code (time >=100000 and time < 230000) , my time zone is Australia Perth. thanks

  26. Player • 04/15/2017 #

    Bonjour,
    J’ai testé cette stratégie sur EurUSD en 1 heures sur 10000 unités et le résultat est catastrophique
    Aurais-je loupé quelque chose ?

    Merci

  27. Player • 04/15/2017 #

    Vue du rapport du Backtest https://ibb.co/8BMrBz6

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar

+43 more likes

Related users ' posts
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 ...
Adolfo Onrubia Ups! Sorry. Variable "S" is to set an specific Spread if needed. Could be "0", or the distan...
GraHal Hi Adolfo, big thank you for your code, but I am a bit confused. Spread is the difference b...
Meta Signals Pro Hi, For me there is a mistake here L32 maxriesgo = round(equity*riesgo) => round(equ...
Doctrading Maybe you can also change the hourly beginning of the day (not 23PM but 12AM, OOH in french)...
Duccio Hi Doctrading,there is a way to control the max loss of the positions in this code? For exa...
Doctrading Hello, Yes, there is a command I think, but I don't know it. Nicolas knows it. You can als...
Dave Hi, I'm new to coding and have been trying to modify the code a little to backtest an idea I...
Nicolas Better use the forums for coding assistance please. You'll get more results there for sure.
Dave Apologies - only just learning the site layout. Maybe you could delete the post?
Nicolas You can try this code for buy and hold curve line: capital = 10000 mylot = 2 i1 = capi...
soukenson Bonjour Nicolas, Je ne comprends pas où ajouter le code que tu as a donné dans le code initi...
Nicolas Tu veux parler du code pour comparer avec le "buy and hold" ? Si oui, tu as tout ce qu'il fa...
Nicolas FR/Bonjour Steftonio, non pas de frais overnight calculé sur la durée du backtest, c'est une...
avatar
Anonymous Any reason why in 2016 this system is doing very bad respect the previous years?
Nicolas "very bad" is relative to the account equity. I do not forward test this strategy since I po...
EAxelsson Hi, shouldn´t it be or instead of and? if FiftyTwoWeekHigh = FiftyTwoWeekHigh[1] OR FiftyTwo...
qigley Line 4 has a redundant term "Close>EMA2." is not necessary as EMA2 will always be less t...
Mike.44 Thanks It a good job !
Wisko But the BUY-trigger is below the High of the first two 15min-candels?
Nicolas That's right, because what we want is to enter the market quickly and not wait for the next ...
Wisko Then I don't understand the backtest data. Yesterday (28.9.) range was from ~ 4410,5 - 4450,...

Top