This a modified MAC-Z using Z-VWAP. Since this uses VWAP , the signals are derived indirectly from both volume and price action.
I have also included a way to smooth MACZ-VWAP, you can enable it via options page.
Referenced indicators:
Z-distance from VWAP
(description from original author: Lazybear).
Note that this will work only on instrument with Volumes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
//PRC_MACZVWAP | indicator //10.05.2022 //Nicolas @ www.prorealcode.com //Sharing ProRealTime knowledge //converted from pinescript // --- settings fastLength = 12 //MACD Fast MA Length slowLength = 25 //MACD Slow MA Length signalLength = 9 //MACD Signal Length lengthz = 20 //Z-VWAP Length lengthStdev = 25 //Stdev Length A = 1.0 //MACZ constant A B = 1.0 //MACZ constant B useLag = 1 //Apply Laguerre Smoothing (0=false ; 1=true) gamma = 0.02 //Laguerre Gamma // --- end of settings source=customclose mean = summation[lengthz](volume*close)/summation[lengthz](volume) vwapsd = sqrt(average[lengthz](pow(close-mean, 2))) zscore = (close-mean)/vwapsd fastMA = average[fastLength](source) slowMA = average[slowLength](source) imacd = fastMA - slowMA maczt=zscore*A+ imacd/std[lengthStdev](source)*B if uselag and maczt>0 then s = maczt g = gamma l0 = (1 - g)*s+g*(l0[1]) l1 = -g*l0+(l0[1])+g*(l1[1]) l2 = -g*l1+(l1[1])+g*(l2[1]) l3 = -g*l2+(l2[1])+g*(l3[1]) macz=(l0 + 2*l1 + 2*l2 + l3)/6 else macz=maczt endif signal = average[signalLength](macz)*50 hist=macz-signal return hist coloured("red",85) style(histogram),macz coloured("green") style(line,2),signal style(line,3), 80 style(dottedline2,2) coloured("red"), -80 style(dottedline2,2) coloured("lime") |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials
Bonjour Nicolas
Cet indicateur semble intéressant à priori, chacun mettra les valeurs à sa guise, personnellement je pose des paramètres plus rapides.
Serait il possible d’avoir le même code avec le signal sur le graphe prix
merci, bonne journée
Bonsoir , Nicolas , j’ai transféré votre indicateur sur ma PRT 10,3 et j’ai un méssage d’éreur : ligne 22 caractère 35 , pouvez-vous m’aider SVP , merci d’avance . Salutations .
Vous pouvez essayer en remplacant la ligne avec:
vwapsd = sqrt(average[lengthz](square(close-mean)))
Bonsoir , merci Nicolas , a bientôt .