ZigZag SupDem (supply and demand zones)

v10.3
ZigZag SupDem (supply and demand zones)

The ZigZag SupDem Zones Indicator detects support and resistance (supply and demand) zones using peaks and troughs formed by the ZigZag.
Depending on the timeframe used, it is necessary to set the necessary percentage to form a new peak or trough, by default that is set to 3%, ideal for most instruments on a unit of daily time.

The detection will be done only on the last periods set by the variable “lookback”.
The detection is validated if the indicator finds at least “minPoints” troughs or peaks not more distant than at most “threshold” in percentage.

  • percent = 3 (percentage change of ZigZag to get new peaks and troughs, new swings)
  • lookback = 200 (the period to search for supports and resistances)
  • threshold = 1 (percentage to validate another zigzag from the one previously found to validate a support or a resistance)
  • minPoint = 2 (at least it takes 2 swings of the same type, located one another less than “threshold” percent to validate a support or resistance)

 

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. Makabro • 03/13/2019 #

    Hola Nicolas,tengo un problema cuando importo el .itf pone que esta instalado correctamente,pero cuando lo añado ,se añade debajo del precio en una ventana nueva,como si fuese un rsi o un macd…me salen las velas de frenada y compra, pero me salen por abajo no en el mismo precio…como podría arreglarlo ?
    Felicidades por el trabajo realizado.

  2. Nacho Bosquet • 03/13/2019 #

    Hola Nicolas,…. ¿Tienes disponible algún screener para ondas de wolfe? Haces un trabajo increíble!!!! Gracias!!!

  3. pedrohcarvalho@yahoo.com.br • 03/13/2019 #

    Hola Nicolas, por si acaso tienes el código de la funccion ‘ ZIgZAG’ ? O… sabrias como desarrollar solamente esta funccion? Muchas Gracias!!!

    • Nicolas • 03/13/2019 #

      Esta función es interna y no puede reproducirse con el mismo comportamiento por código (repita en tiempo real la última parte superior o inferior).
      Los indicadores de fractales también son un buen enfoque para encontrar las partes superiores e inferiores, hay muchos indicadores basados en ellos en la biblioteca.

  4. MrMUCKIE • 03/13/2019 #

    Would there be a way to derive these support/resistance figures for automatic trading?

    • Nicolas • 03/13/2019 #

      That’s not possible because the code uses ZigZag instruction from the platform which is not reliable for automatic trading (and not allowed by the system).

  5. MrMUCKIE • 03/13/2019 #

    Thanks Nicolas. Do you have any idea of how I could generate support/resistance figures for automatic trading?

    • Nicolas • 03/13/2019 #

      Try fractals, swing high/low points, donchian channel, ..

  6. IV Mcm • 03/13/2019 #

    Thank you for this indicator Nicolas, very useful for Range detection.

  7. MrMagic • 03/13/2019 #

    Hi @Nicolas , I tried importing the ITF files and even directly copying the above indicator into my PRT and it came up blank both times. Is there something I’m missing?

    • Nicolas • 03/13/2019 #

      Try to modify the settings? The percentage of zigzag might be too large?

    • MrMagic • 03/13/2019 #

      Sorry for the late response. I gave up using it. Tried modifying the settings but it still came up at the bottom of the chart blank. It’s also comes up different from the photo above where it creates a different space for the indicator rather than show on the price as above.

    • Nicolas • 03/13/2019 #

      If you add it on the price chart (by using the wrench on the left upper side of the price chart), then it should comes up on the main chart 🙂

  8. MrMagic • 03/13/2019 #

    Thanks. On point. 🙂

  9. Marie Chidais • 03/13/2019 #

    Modifs:
    ajout du prix
    A faire tourner en 1 heure 50 unités dans tout petite fenêtre.
    Alors merci au créateur.

    //PRC_ZigZag SupDem | indicator
    //13.03.2019
    //Nicolas @ http://www.prorealcode.com
    //Sharing ProRealTime knowledge

    defparam drawonlastbaronly=true
    defparam calculateonlastbars=1000

    // — settings
    //ecartmini = 3 //zigzag ecartmini
    //lookback = 100 //max history lookback
    //eliminanciens = 1 //price ecartmini between 2 ZZ points
    //minPoint = 2 //minimal points to confirm S/R
    //showSupport = 1 //plot support zones or not? (0=false;1=true)
    //showResistance = 1 //plot resistance zones or not? (0=false;1=true)
    // — end of settings

    //zz s/r
    zz = ZigZag[ecartmini](customclose)
    p = zzzz[2]
    t = zz>zz[1] and zz[1]<zz[2]
    if p then
    top = zz[1]
    endif
    if t then
    bottom = zz[1]
    endif

    once minPoint = max(2,minPoint)

    for i = 1 to lookback do
    if showResistance then
    //new peak
    if p[i] then
    topdata = top[i]
    hhtop = topdata+(customclose[i]*(eliminanciens/100))
    lltop = topdata-(customclose[i]*(eliminanciens/100))

    resttest=0
    for y = i to lookback do
    resttest = resttest + (top[y]lltop)
    if resttest>=minPoint then
    //drawarrowdown(barindex[i],topdata) coloured(255,0,0)
    drawsegment(barindex[lookback],topdata,barindex[1],topdata) coloured(255,0,0)
    DRAWTEXT(“#topdata#”,barindex+5,topdata,SansSerif,Bold,14)coloured(153,153,0)
    break
    endif
    next
    endif
    endif
    if showSupport then
    //new through
    if t[i] then
    data = bottom[i]
    hh = data+(customclose[i]*(eliminanciens/100))
    ll = data-(customclose[i]*(eliminanciens/100))

    suptest=0
    for y = i to lookback do
    suptest = suptest + (bottom[y]ll)
    if suptest>=minPoint then
    //drawarrowup(barindex[i],data) coloured(0,255,0)
    drawsegment(barindex[lookback],data,barindex[1],data) coloured(0,255,0)
    DRAWTEXT(“#data#”,barindex+5,data,SansSerif,Bold,14)coloured(153,153,0)
    break
    endif
    next
    endif
    endif
    next

    hprice = highest[lookback](customclose)
    lprice = lowest[lookback](customclose)
    drawsegment(barindex[lookback],hprice,barindex,hprice)
    DRAWTEXT(“#hprice#”,barindex+5,hprice,SansSerif,Bold,16)coloured(153,153,153)
    drawsegment(barindex[lookback],lprice,barindex,lprice)
    DRAWTEXT(“#lprice#”,barindex+5,lprice,SansSerif,Bold,16)coloured(153,153,153)

    prix = Close
    return prix as “supports et résistances” //coloured(153,153,0)
    //

  10. datageek • 03/13/2019 #

    How do I change the thickness of the line or change it too dashed lines? Kind regards

  11. lkiklkik • 187 days ago #

    NE fonctionne pas ( ou plus … )

    • Nicolas • 186 days ago #

      il faut modifier toutes les références à top par itop et bottom par ibottom. Ces mots étant désormais réservés à des instructions, dut à l’évolution du langage.
      En théorie en téléchargeant le fichier itf attaché et en l’important la modification se fait d’elle même.

avatar
Register or

Likes

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

+2 more likes

Related users ' posts
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.
mathiasKN Steffen Schmauch • 12/11/2018 # hello Nicolas, can I change the indicator that I only get t...
Nicolas Please open a new topic in the indicator forum and explain there your query, thank you.
upupandaway This seems like a very useful indicator. However, it does not seem to open properly in the c...
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.
teddy58 Ich habe es mit N= 1,5 und N=2,5 getestet mit 200000 Einheiten. Es funktioniert leider erst ...
Matriciel I use this indicator to help me make a decision when there is a divergence. The divergences ...
Jan Wind Hi, I personnaly am not a big fan of ZIGZAG indicator, as it repaints itself during time. ...
Nicolas Sure, I suggest you open a new topic in the forum to discuss about your ideas.
hdgm Bonjour Nicolas, est ce que l'on peut en faire une stratégie de trading automatisée ?
Nicolas Non, pas en utilisant l'indicateur zigzag traditionnel de la plateforme.
TACBOLSA
6 years ago
Tradingrob Hi Tac Bolsa, thanks for the information. But after carefully ready all the material i still...
TAC Bolsa Hello, the indicator creates the support depending on the volume and is dynamic.
carlvan Not working on PRT 11.1. And the site https://www.tiburonesdealetacorta.com does not exist....
Gianluca ok i fixed it i hope is ok like this: //TAC trader zone 10.2 | indicator //01.01.2018 //R...
TAC Bolsa Hello try this new version or view the blog with the new indicators .. https://www.t...
TAC Bolsa Sorry, TAC Trader Zone V2 https://www.tiburonesdealetacorta.com/2018/11/indicador-tac-tr...
rama I want to use this indicator in trading system, it says zig zag is obsolete and not supported
Nicolas Right, due to its repainting behavior, the zigzag is not allowed in automated trading with r...
rama I noticed it changes as time progress, I am 7 as the average, how many period it wont chang...
FULVIO09 Attualmente non c'è sufficiente volatilità : la condizione "C0 = AverageTrueRange[1500](Clos...
vlongobardo67 Ma io intendevo in backtest ! Scusa non l’ho menzionato.
ciniselloftse salve fulvio .il trading sistem e sempre profittevole?
cervantes2 Buenas tardes y gracias por este magnifico indicador. Queria saber si tienes un proscreener ...
cervantes2 Que busque los valores que la linea verde acaba de cruzar al alza o a la baja
AngelPujalt Tenéis algún screener de este indicador?
Yannick Hello There is a mistake in trailing stop code, I think that this should fix the problem s...
Paul About the trailing-stop the way it's coded. That works for backtesting only, just look at th...
Jonny sorry paul, but system says that is not possible to put many stop order combined...what have...
s00071609 I am using this indicator but it keep crashing as i change the timeframe. For example, chang...
Nicolas in the mean time you can try this one: https://www.prorealcode.com/prorealtime-indicators/ho...
Gianluca Is it possible to have an indicator where those value are as instogram ? and separated? in o...
rb-72 Thank you, area of twist by dilatacion of the price, missing part of the code that is not pu...
Thomas007 after reading your blog now I understand why there is only a part of your code here. I'm try...
Juanjo Hola¡¡ la estrategia se podria aplicar sobre acciones con marco temporal diario?? gracias.
Leo Hi all, I posted a new version of this indicator ( I just add arrows to spot the local maxi...
Trading_En_El_Ibex35 Muchas Gracias por compartir este interesante indicador. Un saludo
xavieralava hola gracias leo
Nicolas https://www.prorealcode.com/topic/ayuda-screener-indicador-perfect-trend-line/#post-51291
Manu L. Bonjour Nicolas, suite a une de mes precedentes demande dans le forum indicateur, j'ai touv...
AntoGH C'est selon moi le meilleur indicateur, que j'ai vu, si vous trouvez mieux dîtes moi car dif...
Wing Not yet but I plan to.
Leo Have a look in this Forum, I got something interesting for you... https://www.prorealcode.co...
Dávid Gyalus Dear Wing, As I am a daytrader, and one of my best friend is a programmer we think your a...
Nicolas Questo indicatore è stato progettato solo per i dati intraday, ma potrebbe essere adattato a...
MrCrous //FR Bonjour, Dans le code ci dessus, je ne comprends pas ce que fait la ligne : linea...
Nicolas J'ai déjà répondu à cette question quelque part sur le forum. Il faudrait chercher un topic ...
Wing Yes, investigate as much as you want. For more insight, you can view the linet1, linet2 etc....
CKW Hi Wing, Thanks for your sharing. I am still trying to breakdown & understand your code...
Wing Hello CKW. No, the parameter, 7 in this case, is used when calling the RSI indicator to ide...
Nicolas
8 years ago
Nicolas add it on price chart, change the cp parameter according to the period you want to observe f...
Robert22 hola buenos días: yo estoy buscando una cosa parecida para realizar con ello un indicador de...
Nicolas https://www.prorealcode.com/prorealtime-indicators/rsi-classical-hidden-divergences-indicator/

Top