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
Bard Very interesting approach Vonasi! I'm getting a 404 error when trying to download though?
Vonasi I just tested and I was able to download with no error.
Psari Hi Vonasi, I am a newbie and was wondering whether you could possibly help me with this pro...
Vinks_o_7 Thanks again Vonasi !
Bard Thank you, this is a great tool @Vonasi, especially for those that used to like shorting Ind...
Aragorna Hi Vonasi, is there a reason why it does not work anymore in new version ePRT Platform? tha...
sycomore Ça ne fonctionne sur aucune valeur, je dois être trop con...
Nicolas il faut appliquer l'indicateur sur le prix.
AntoGH Je crains de ne pas comprendre... Cela indique la probabilité de la prochaine bougie ou donn...
murre87 No Stoploss?
bousalahane Hi Rajesh Deshpande, Thank you for this code, I see that the code is perfect, but the posit...
Bibi83 Bonsoir à tous Je viens de backtest la stategie sur EUR/USD en graphique 1H sur 1 mois et ...
Vonasi Yes that was the issue. I have posted an updated ITF file here: https://www.prorealcode.com/...
crolakstrading @vonasi Thank you for fixing the issue! This is a great indicator.
gregoire good evening vonasi , I had made the request to create this indicator a few years ago and I ...
tobytarczy Hi Vonasi, Sounds lovely, I race yachts around europe myself. Most regattas cancelled unfor...
mlouys Hello Vonasi thank for your work ! A question how can we do it for minutes ( or 15 min or x ...
Vonasi I think that would be possible but probably in a whole new indicator as detecting when a new...
sir_i Bonjour à tous, Je suis nouveau sur le forum et sur la plateforme, pourriez-vous me dire com...
Nicolas Il faut simplement l'appliquer sur le prix.
sir_i Merci pour la réponse, je ne suis pas familier avec l'application de cette procédure simple,...
Nicolas change the lastline with: RETURN lastsig and check if lastsig change its value with the a...
nectouxg Hello Nicolas, I will try tonight when I get home, just one last question, I trade the DA...
FXtonio Bonjour, j'ai un problème avec le code, il me dit que ce n'est pas correct ligne 26-27-28: ...
Vonasi There is another version of this indicator that can plot the same lines but onto an indicato...
Martin35 Hello Vonasi, do you think it is possible with PRT to code with the same principle as on thi...
abhay I am getting a shading between the lines, how can I avoid that. I just want to see lines as ...
Vonasi Delete the 'Color Zone' in the indicator settings window.
Janfi Hello, I'm new to ProRealCode and I do not understand the following summation[n](indicator...
Kaci It seems he's just checking that the previous MACD is < 0 for maximum one period ? I'...
Daniel Martin Hi do you know how have and entry after the second cross? There is crosses below 0 and cross...
mscharstrom Hi @robertogozzi, I really love this indicator. However, I'd like to tinker with it to fit ...
Ahimsa Hi Roberto I cannot thank you enough for writing this code. It could help me more than you ...
Nicolas With PRT v11, you have to click on "price" at the upper left side of the price chart.
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
Paul the last update can be found in topic Strategy DayOpen Straddle for DAX on page 14.
bertrandpinoy l instruction GRAPH pose problème sur PRT... pas vous? cordialement
Nicolas Supprimer simplement les lignes avec GRAPH pour passer en ProOrder, trading live.
Bhanu Pratap Dear Sir, Can I get MQL4 File for this indicator and last man standing . pls looking forward...
ISTJ_T Hi Nicolas Thanks a lot for the indicator. Trading off the TradingView and have issues wit...
Nicolas Just use ProRealTime and its powerful screener for stocks.
fredfilm Hi Nicolas, how could we add a price screen to this? eg stock prices between $1 to $3 etc
Simba Greetings from germany! :) Can you told me your EXIT-strategy for this, please? :) Would ...

Top