Multi Fractals ZigZag High/Low

v10.3
Multi Fractals ZigZag High/Low
Second version of this indicator, first one can be found here: http://www.prorealcode.com/prorealtime-indicators/fractals-zigzag/

This new version draw only High/Low points of the fractals zigzag on chart. It draws major points (green and red squares) which are calculated with a lookback of 20 periods by default ("cp" parameter can be changed at will).

The minor points (green and red dots) are calculated the same way but with the default period divided by 2 (so 20/2=10 periods by default).

This indicator can be used to trade 123 pattern of any other kind of breakout strategies.
//---external parameters
//cp = 20

once lastpoint = 0
ATR = averagetruerange[cp]

//---major zigzag points
if high[cp] >= highest[2*cp+1](high) then
LH = 1
else
LH = 0
endif

if low[cp] <= lowest[2*cp+1](low)  then
LL = -1
else
LL = 0
endif

if LH = 1 then
TOPy = high[cp]
TOPx = barindex[cp]
endif

if LL = -1 then
BOTy = low[cp]
BOTx = barindex[cp]
endif

if LH>0 and (lastpoint=-1 or lastpoint=0) then
DRAWTEXT("░",TOPx,TOPy+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
lastpoint = 1
endif
if LL<0 and (lastpoint=1 or lastpoint=0) then
DRAWTEXT("░",BOTx,BOTy-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
lastpoint = -1
endif

//---mino zigzag points
if high[round(cp/2)] >= highest[cp+1](high) then
LLH = 1
else
LLH = 0
endif

if low[round(cp/2)] <= lowest[cp+1](low)  then
LLL = -1
else
LLL = 0
endif

if LLH = 1 then
LTOPy = high[round(cp/2)]
LTOPx = barindex[round(cp/2)]
endif

if LLL = -1 then
LBOTy = low[round(cp/2)]
LBOTx = barindex[round(cp/2)]
endif

if LLH>0 then
DRAWTEXT("º",LTOPx,LTOPy+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
endif
if LLL<0 then
DRAWTEXT("º",LBOTx,LBOTy-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
endif

RETURN
 
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. supertiti • 262 days ago #

    Bonjour Nicolas

    Quand je veux changer la valeur de CP : l’indicateur plante ! je suis tout seul dans ce cas ?

  2. Traderfox06 • 261 days ago #

    Dear Nicolas,

    I receive the following message:

    Fehler im Indikator: PRC_MultiFractalsZigZag (20)
    Syntax-Fehler: Linie 31, Zeichen 9
    Eines der folgenden Zeichen eignet sich besser als “(“:
    – “,”
    – “=”

     

    Any ideas?

    Thanks and kind regards,

      Michael

  3. supertiti • 261 days ago #

    Le changement de la variable CP plante toujours ! il n’y a que moi dans ce cas ?  merci de me donner vos retours

    bonne journée

  4. supertiti • 261 days ago #

    Air liquide par exemple, je travaille avec tout le SRD et c’est pareil pour tout.

    j’ai rajouté dans le code : cc = customclose

    d’autre part impossible de remonter une image du message d’erreur dans ce post !? ( vous n’avez pas l’autorisation )

    • Nicolas • 261 days ago #

      Ok je vais chercher pourquoi, je n’ai pas eu le problème. C’est peut-être un problème d’arrondi à ajouter au calcul des points intermédiaires.

  5. Fr7 • 260 days ago #

    Salut Nicolas
    Est-ce basé sur repaints indicateur zigzag ?

    • Nicolas • 260 days ago #

      Bonjour, cet indicateur ne repeint pas. Les Zig et Zag se tracent à la détection des nouveaux fractals.

  6. miguel33 • 258 days ago #

    Non c’è nessuna possibilità per  il Fractal zig zag di farlo vedere anche sulla versione 10.2  ?

     

  7. Traderfox06 • 255 days ago #

    Salut Nicolas,

    my broker IG told me, that they will not upgrade to 10.3 for a long period
    since they have implemented 10.2 just this year.

    Is there any chance to downgrade this code to 10.2 (guess many user here trade with IG)?

    At least this piece of code?

    I receive the following message:

    Fehler im Indikator: PRC_MultiFractalsZigZag (20)
    Syntax-Fehler: Linie 31, Zeichen 9
    Eines der folgenden Zeichen eignet sich besser als “(“:
    – “,”
    – “=”

    Many thanks in advance.

    Kind regards,

      Michael

    • Nicolas • 255 days ago #

      Hi Traderfox06, sorry but the results with v10.2 would not be the same all, visually. The last fractals zig-zag would be shown on the current candlestick and not well placed on the higher high and lower low in the past (left part of the chart). Of course, if you don’t need it to be visually accurate on what candlesticks appeared the fractals, the returned values are still correct and could be interpreted by an automated trading strategy for instance.

       

  8. Madrosat • 241 days ago #

     Bonjour Nicolas

    Il plante chez moi également si je change la valeur cp   et parfois même sans. Je parle bien sur en  version 10 3 

    Pourra t on l’utiliser dans une stratégie??

    Bonne journée

    Madrosat

    • Nicolas • 241 days ago #

      Je pense qu’il plante uniquement quand cp n’est pas un chiffre pair ? Si oui, je peux corriger ce problème.

    • Nicolas • 240 days ago #

      J’ai corrigé le code, il n’y a plus de problème de plantage qui était dut au calcul d’arrondi des périodes des fractals intermédiaires.

  9. Nicolas • 240 days ago #

    For everyone information, code has been updated to fix the crash of the indicator due to bad periods calculation for the intermediate minor fractals.

  10. Madrosat • 238 days ago #

    Bonjour Nicolas et bon dimanche

    c’était une question de round !!!   , il ne plante plus  et donne un visuel intéressant.

    J’ai essayé de l’arranger pour avoir des signaux et le tester en backtest voici le code 

    que j’ai essayé de créer mais ça ne marche pas , je n’ai pas suffisamment de pratique 

    pour le modifier correctement , je compte sur toi pour y remédier .

    cordialement

    Madrosat

    //---external parameters Indicateur Multi Fractals ZigZag High Low essais de modifications avec ajouts de signaux
    //cp = 20
    
    once lastpoint = 0
    ATR = averagetruerange[cp]
    
    ///---major zigzag points
    if high[cp] >= highest[2*cp+1](high) then
    LH = 1
    else
    LH = 0
    endif
    
    if low[cp] <= lowest[2*cp+1](low)  then
    LL = -1
    else
    LL = 0
    endif
    
    if LH = 1 then
    TOPy = high[cp]
    TOPx = barindex[cp]
    endif
    
    if LL = -1 then
    BOTy = low[cp]
    BOTx = barindex[cp]
    endif
    
    if LH>0 and (lastpoint=-1 or lastpoint=0) then
    signal = 1
    DRAWTEXT("º",LTOPx,LTOPy+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
    lastpoint = 1
    endif
    if LL <0 and (lastpoint=1 or laspoint=0) then
    signal=-1
    DRAWTEXT("º",LBOTx,LBOTy-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
    laspoint = -1
    endif
    
    ////---mino zigzag points
    if high[round(cp/2)] >= highest[cp+1](high) then
    LLH = 1
    else
    LLH = 0
    endif
    
    if low[round(cp/2)] <= lowest[cp+1](low)  then
    LLL = -1
    else
    LLL = 0
    endif
    
    if LLH = 1 then
    LTOPy = high[round(cp/2)]
    LTOPx = barindex[round(cp/2)]
    endif
    
    if LLL = -1 then
    LBOTy = low[round(cp/2)]
    LBOTx = barindex[round(cp/2)]
    endif
    
    if LLH>0 then
    signal=0.5
    DRAWTEXT("º",LTOPx,LTOPy+ATR/2,Dialog,Bold,20) coloured(200,0,0,255)
    endif
    if LLL<0 then
    signal=-0.5
    DRAWTEXT("º",LBOTx,LBOTy-ATR/2,Dialog,Bold,20) coloured(0,200,0,255)
    endif
    return signal as"signal"
    

     

    • Nicolas • 238 days ago #

      Ce que tu as fait semble correct pour moi. La variable que tu as nommé “signal” doit correctement retourné ce qu’a était le dernier fractal trouvé sur l’historique. Il ne faut pas oublier que les fractals s’affichent dans le passé et ne sont bien entendu pas affiché en temps réel. On ne peut jamais savoir si on se situe à un dernier plus haut ou à un dernier plus bas en temps réel.

  11. Madrosat • 237 days ago #

    Bonjour Nicolas

    merci pour cette précision que je soupçonnais , donc difficile à utiliser dans une stratégie .

    Le code ci-dessus n’est pas bon   La plateforme me retourne : La variable suivante n’est pas utilisée dans le programme : topy   topx  boty botx

    Bonne journée

    Madrosat

     

     

    • Nicolas • 237 days ago #

      Ces variables ne sont utiles que pour le tracement des objets graphiques de l’indicateur. Pour les fractals, seules les variables LL,LH,LLL et LLH sont importantes et nécessaires.

  12. Madrosat • 234 days ago #

    ok 

    Merci Nicolas

  13. Sofitech • 233 days ago #

    Bonjour Nicolas.
    Est-ce que la V3 permet de créer des trendlines au delà du prix actuel (sur la droite) ?
    Par exemple, est-ce qu’un indicateur trendline basé sur le Multi Fractals ZigZag High/Low serait réalisable ? Tracer une ligne à chaque nouveau point haut / bas. Une ligne rouge reliant les points haut et verte les points bas.

    • Nicolas • 233 days ago #

      Oui ce serait possible. Dans la 10.3, les DRAWLINE se projette à travers tout le graphique, sur la droite et la gauche.

  14. ghary • 231 days ago #

    Bonjour,

    Est il possible d’avoir ce code avec la version V2 , n’ayant pas encore la V3 ? Sans forcement avec les dessins, un point à la place devrait être suffisant non ?

    Merci pour les réponses.

  15. Fabio Anthony Terrenzio • 204 days ago #

    I made a version for 10.2

    • Nicolas • 204 days ago #

      Nice! You could  share them on the Library.

  16. Fabio Anthony Terrenzio • 204 days ago #

    I’m sorry, it’s not true

  17. franjue • 202 days ago #

    Salut Nicolas,

    une question: cet indicateur repaints que tous basés sur le zigzag?
    • Nicolas • 202 days ago #

      Par définition un ZigZag repeint le passé puisque que l’on ne sait jamais si le dernier plus haut ou plus bas atteint est bien le dernier. Sauf que celui-ci ne le permet pas puisqu’il se base sur les fractals et que dans le code je lui indique qu’il ne pourra pas le faire (pas de modification d’un signal plus bas pas un nouveau plus bas). Donc c’est un zigzag “adapté” que tu trouveras dans cet indicateur.

    • franjue • 202 days ago #

      Merci Nicolas. Cette semaine, nous allons prouver en temps réel. Je vais vous informer des résultats.

    • Nicolas • 202 days ago #

      Bien, mais il ne faut pas oublier qu’un fractal s’affiche dans le passé, pas en temps réel, car il faudra évidemment tester ses conditions .. avant de l’afficher 🙂

      Pour qu’il soit plus rapide, tu peux modifier le paramètre “cp”, à 20 périodes par défaut.

  18. ghary • 183 days ago #

    Bonsoir

    Personne n’a réussi à mettre une version pour la V2 ?

     

    Merci bonne soirée.

  19. Assaf • 164 days ago #

    Thank you Nicolas for sharing this wonderful indicator with us.

    Can you please advise how can we use the symbols in a scanner. I want to scan all stocks that had symbol drawn on their daily charts in the previous 5 days.

    Thanks,

    Assaf

  20. learner • 164 days ago #

    Hi Nicholas,

    I am a newbie, just registered on this website today. Is your indicator free to use on Pro Real Time? Thanks in advance.

    • Nicolas • 164 days ago #

      Everything’s here is for free! Download and import files into your platform that’s all 🙂

  21. learner • 164 days ago #

     Thanks Nicholas for your swift response. With this indicator, the green square is a potential buy while the red square is a potential sell,right? Can this be applied to any market?

    • Nicolas • 164 days ago #

      It depends how you trade it. It could also be considered as potential breakout points because of identifying the recent highest high and lowest low. It is only calculated with price information, so yes it is an “universal” indicator.

  22. learner • 164 days ago #

    brilliant thanks

  23. learner • 163 days ago #

    Hi Nicolas,

    I am getting syntax error with DrawText command while using this indicator. The error is as below:

    One of the following characters would be more suitable than “(“

    Can you please help.

  24. learner • 163 days ago #

    Hi Nicolas, looking at the previous posts, you have already answered this question. Is there a code, I could use on version 10.2?

  25. century • 163 days ago #

    marche parfaitement, merci pour cet indicateur très utile

  26. faisal1000 • 134 days ago #

    Hi,Does multi fractals zigzag high /Low work on Mt4?

    How can i make it working on Mt4?

    Thanks,

     

    • Nicolas • 134 days ago #

      Hello this website is dedicated to prorealtime programming. I can help people with PRT and convert MT4 indicators for it, but I can’t help about MT4 related stuff sorry…

  27. ibrahimchauvin • 123 days ago #

    Bonjour, PRT peut ne pas reconnaître la valeur CP. Dans ce cas, j’ai simplement modifié le début :

    //---external parameters Indicateur Multi Fractals ZigZag High Low essais de modifications avec ajouts de signaux
    //cp = 20

    Que j’ai remplacé du coups par :

    //---external parameters
    cp = 20

    Un tout petit changement qui débloque le code. Merci pour le partage !

  28. Raul Vg • 108 days ago #

    Hello Nicolas,

    The first thing I want to say is: thanks for your work. And the second is: sorry for my english 🙂

    I have a question. Does this indicator use the Zig Zag indicator? I understand that the zig zag indicator can not be used live because it recalculates once passed. 

    So all indicators based on the zig zag flag are 100% winners.

    I ask the question because I see that this indicator has almost total success and I find it impressive if it does not recalculate once passed.

    Thank you very much for your time

    • Nicolas • 107 days ago #

      This indicator does not use zig zag at all. It’s built on fractals and it doesn’t repaint. I called it zigzag because it shows peaks and valleys too. 

  29. Seemore Profit • 93 days ago #

    Hi for some reason i cant get this indicator to look like yours. Any ideas?

     

     

    • Nicolas • 93 days ago #

      What is your problem exactly please?

  30. Johan • 74 days ago #

    Hey Nicolas, great stuff! Just starting to play around with it. Can you explain to me how, if i would like to get a fib level between two points (high-low/low-high)?

    • Nicolas • 74 days ago #

      Yes, could probably be a good coding exercise, please add a request on forums!

    • Johan • 74 days ago #

      Ok. I’ll do that!

  31. Seemore Profit • 65 days ago #

    Nothing gets added, a indicator sections opens on the bottom part of the chart but nothing anywhere all blank

    • Nicolas • 65 days ago #

      Please add it on price instead. Use the wrench at the upper left side of the chart.

  32. Loop • 61 days ago #

    Hi Nicolas,

    would it be possible to have a tradins system based on this indicator?

    I tried but it’s too complicate for my skills…

    Thanks a lot!

  33. geoken • 59 days ago #

    Hi! Is there any way to set an audio alarm or pop-out box alert when the fractal appear?  Any suggestions is greatly appreciated. 

    Thank you

    Ken

  34. Stenozar • 26 days ago #

    Buongiorno Nicolas, mi scuso per l’ignoranza, ma non ho capito come si può utilizzare questo indicatore. Potrebbe spiegarlo brevemente?

    Grazie!

    • Nicolas • 26 days ago #

      Questo indicatore disegna picchi massimi ei minimi basso per determinare le zone di supporto e resistenza. È tutto 🙂

  35. NYORKA • 15 days ago #

    Hello Nicolas

    Can this code be transferred to Tradingview charts? Thanks

    • Nicolas • 15 days ago #

      Certainly, but I will not do it.

avatar
Register or

Likes

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

+7 more likes

Related users ' posts
gabri
13 hours ago
DeMarker Indicator
DeMarker Indicator
0
Indicators
albertocampagna Sei grande Nicolas :-)
SAcht Dear Nicolas, Great work, thank you very much!I would love to use the indicator in ProScree...
SAcht btw: The above-posted ProScreener is supposed to show stocks for which the center line has i...
Andy 22 DRAWSEGMENT(BarBullNew, highest[(BarBullnew-BarBullOld)](close), BarBullNew+10, highest[(...
gabri Ok, I believe your version of PRT doesn't support the command drawsegment. You should check ...
Andy ok thanks!
albertocampagna Salve, bellissimo indicatore, ma purtroppo non riesco a farlo funzionare
Nicolas Another fine piece of code gabri! Excellent work again. Thanks a lot for your precious contr...
gabri Thanks Nicolas!!
bolsatrilera bravo, molto intelligente.
Nicolas
1 week ago
Loop Hi All! Would it be possible to have the same indicator with the MACD calculated with the DE...
Nicolas Why not, but do you think it would make such a noticeable difference?
Loop Good question Nicolas! That's why I was curious to check it! MACD based on DEMA is usually m...
bolsatrilera
2 weeks ago
gabri
2 weeks ago
AleX ho provato anche per febbraio e la strategia ha il 75% di risultati positivi e quelli negati...
gabri  Codificare il CSI e' possibile. Io uso una sua modifica (siccome lavoro solo sull'azionario...
gabri Dopo Pasqua codifichero' anche un altra strategia che Wilder suggerisce di usare quando il m...
diegofe_2000 gracias , muy bueno
iramirez55 Bonjour, excusez mon français. Est-il possible de mettre les résultats des stratégies dans E...
Nicolas Please ask general purposes questions on forums. Thanks. 
Sofitech What is the timeframe(s) you woul suggest to use for this method ?On Forex and/or on stock m...
Doctrading Hello, Higher timeframes are better. I suggest D1 or H4.Best regards,
Nicolas It's a platform related problem currently being investigated. 
JohnVS okay thanks, Hopefully u had a chance to check the other question too? Since the stock hav...
Nicolas I'm pretty sure you can do it yourself John! Please don't be shy :)
supertiti amplitude 1.2.3  = ( 2-6-30 ) or (1-1-27) ?
LUCASSEN Hallo Supertiti Macd amplitude=1-1-27    and    prc halftrend triple in Heikin Ashi  grafie...
supertiti Thanks you so much Lucassen
Nicolas
3 weeks ago
Nicolas Ligne 44 à modifier par r=0 Ligne 55 à modifier par g = 0 J'ai simplement codé en dur les ...
winkx Bonjour Nicolas, Je vous remercie L'indicateur est très intéressant Après c'est une quest...
Nicolas Les goûts et les couleurs...
owes29 Do a Youtube search for "Revolutionary Indicators Reveal Tops & Bottoms" it explains a v...
owes29 Hi is there anyway to develop this for the pro scanner on daily or hourly scans. so it woul...
Nicolas Of course, please add a query in the proscreener forum.
Elsborgtrading I have moved the development topic https://www.prorealcode.com/topic/development-of-initial-...
Elsborgtrading Sometime along the way since I coded the Indicator something has change in PRT- at least I t...
Elsborgtrading Btw last code was a 10 min TF ver. 

Top