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
Gaspare Ciao Ivan si puo' inserire una strategia su questo indicatore per ottimizzare le variabil...
jacquesgermain sì da aggiungere
Maik2404 auf welchen Wert muss ich die Kompresionsperiode stellen?
jacquesgermain — Période de compression : ce paramètre détermine la période de rétrospection utilisée pour ...
Nicolas
11 months ago
Maxime Baudin Well done Nicolas, creative!
Stenozar Hi Nicolas, please can you explain how to read/use this indicator? thanks!
Roland57800 Bonjour Noobywan, si je comprends bien l'utilisation de ce code que je trouve particulièr...
Noobywan Bonjour, quand la question a été posée dans le forum à celui qui avait fait la requête en am...
Fabian This Code draws only a retangle if the condition has been confirmed and NOT before (in that ...
Guibourse Hi, I'd like to increase the thickness of support and resistance lines. I do not think that ...
JJ Tec Hello. Thanks for the great contribution of the indicator. At the moment, I have modified i...
Khaled Hi Vonasi, I tried to embed your PP Fractals code in a Strategy and it seems to be a good fi...
Manu L. Bonjour Nicolas, j'ai créé un screener avec l'aide à la prog en TF weekly mais je voudrai...
wtangsiri C'est exactement le même signal que donne le croisement et le décroisement de deux EMA (7 et...
PHAN100 bonjour, j'ai un bug sur le programme recopié prorealtime me dit qu'il y a un problème à ...
PHAN100 bonjour, bravo à l'auteur pour cet indicateur visuel sur le graphique, il nous reste à va...
yeoreum Thank you very much for the screener, it reminds me on Minervini VCP. How to change th...
reecet any codes like this but in minutes and hours rather than days?
PHAN100 bonjour, je viens de tester ce screener, je constate une anomalie...il ne renvoie pas l'e...
Oxxoz Re bonjour Vivien, Il me smeble que 3 mois, c'est 60 séances. Cordialement,
Vinks_o_7 thanks ...and It can be used on a monthly and weekly basis by changing just the duration in ...
nicko Many Thanks Viv. It looks good
Nokis Bonjour Vivien, Comment je peux faire pour adapter ton code afin: De cibler les sociétés q...
sam00075 I tried it today and it gave great results. So a big Thanks !
Nicolas Oui le code est correct et il fonctionne, j'ai de bons résultats sur la liste NASDAQ par exe...
pincherman Bonjour :-) J'ai coller le script dans prorealtime pour jouer avec le supertrend et j'ai un...
Nicolas Vous l'avez sans doute collé au mauvais endroit, dans l'éditeur de code pour les stratégies,...
Bard Hi @Vonasi, this is an excellent tool! I noticed you times by 180 and was wondering why? W...
Bard I have no idea what is wrong with the posting on this website. I have problems editing posts...
Bard And now my first post displays okay? It literally had copies of my orig post all added toget...
Vonasi There are actually two ways to calculate standard deviations and I seem to have used the ver...
Rory Dryden Thank you. Experimenting with it now.
Wolf Hi Vonasi. Thank for this indicator. I like this calculate concept. I think that line 16 thi...
Vonasi Well spotted! It is just a safety check to ensure that no value below 1 can be used otherwis...
Reddington Hi Vonasi! Really nice work, is it possible to re-create this to work in 10.3? Best regards ...
Vonasi Thanks for the compliments. No this is not easily possible in v10.3 because it uses arrays w...
bruces Hi and thank you. I successfully imported original version above and added to my Prorealtim...
carpentier Joffrey Bonjour à tous, Avant tout merci pour ce travail, cependant je suis bloqué quand je l'insta...
carpentier Joffrey Re, C'est ok, j'ai trouvé mon erreur... Cependant sur quel base peut on calculer son CALC...
Aragorna Hi Nicolas, How is it possible to use it in a higher timeframe plotted on a lower timeframe?...

Top