MACD Fake Filter
- This topic has 2 replies, 2 voices, and was last updated 5 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
Similar topics:
Forums › ProRealTime forum Français › Support ProBuilder › MACD Fake Filter
Bonjour,
Un ami qui utilise TradingView m’a parlé d’un indicateur :MACD Fake Filter
Il m’a envoyé le code (voir pièce jointe) mais je ne parviens pas à la convertir afin de l’utiliser dans ProRealTime.
Merci par avance pour votre aide.
Bonne journée
DD
Holà. Ici vous avez le code. C'est quelque chose de différent qui fait que le support du MACD est actualisé à chaque pas du MACD sur la ligne 0. Personnellement, cela me paraît plus intéressant.
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 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
//---------------------------------------------------------------------------------// //PRC_MACD Fake Filter //version = 0 //10.07.2024 //Iván González @ www.prorealcode.com //Sharing ProRealTime knowledge //---------------------------------------------------------------------------------// //-----Inputs----------------------------------------------------------------------// fastlength=12 slowlength=26 signalLength=9 src=close smasource=1 smasignal=1 //---------------------------------------------------------------------------------// //-----MACD------------------------------------------------------------------------// fastema=average[fastlength,smasource](src) slowema=average[slowlength,smasource](src) mymacd=fastema-slowema signal=average[signalLength,smasignal](mymacd) histo=mymacd-signal //---------------------------------------------------------------------------------// //-----MACD average wave height calculation----------------------------------------// if mymacd crosses over 0 then activeWave=1 elsif mymacd crosses under 0 then activeWave=-1 endif if activeWave=1 then cumDnBar=0 CumDnMACD=0 cumUpBar=cumUpBar+1 CumUpMACD=CumUpMACD+mymacd PositiveAverageHeight=CumUpMACD/cumUpBar NegativeAverageHeight=NegativeAverageHeight endif if activeWave=-1 then cumDnBar=cumDnBar+1 CumDnMACD=CumDnMACD+mymacd cumUpBar=0 CumUpMACD=0 PositiveAverageHeight=PositiveAverageHeight NegativeAverageHeight=CumDnMACD/cumDnBar endif //---------------------------------------------------------------------------------// BearishCrossunder = mymacd crosses under signal BullishCrossover = mymacd crosses over signal //---------------------------------------------------------------------------------// //---------------------------------------------------------------------------------// crossUnderAboveAvg = BearishCrossunder and mymacd > PositiveAverageHeight crossAboveBelowAvg = BullishCrossover and mymacd < NegativeAverageHeight //---------------------------------------------------------------------------------// //---------------------------------------------------------------------------------// if crossUnderAboveAvg then drawarrowdown(barindex,signal)coloured("red") elsif crossAboveBelowAvg then drawarrowup(barindex,signal)coloured("lightgreen") endif //---------------------------------------------------------------------------------// //---------------------------------------------------------------------------------// if histo > 0 then if histo<histo[1] then r=0 g=128 b=0 else r=50 g=205 b=50 endif else if histo<histo[1] then r=255 g=0 b=0 else r=128 g=0 b=0 endif endif //---------------------------------------------------------------------------------// return histo coloured(r,g,b)style(histogram),mymacd coloured("blue")style(line,2), signal coloured("orange")style(line,2), 0 as "zero" style(dottedline2) |
Find exclusive trading pro-tools on