MACD Fake Filter
Forums › ProRealTime forum Français › Support ProBuilder › MACD Fake Filter
- This topic has 2 replies, 2 voices, and was last updated 1 year ago by
etrading.
Viewing 3 posts - 1 through 3 (of 3 total)
-
-
07/10/2024 at 1:39 PM #235011
Bonjour,
Un ami qui utilise TradingView m’a parlé d’un indicateur :MACD Fake FilterIl 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
DD07/10/2024 at 7:41 PM #235032Holà. 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.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485//---------------------------------------------------------------------------------////PRC_MACD Fake Filter//version = 0//10.07.2024//Iván González @ www.prorealcode.com//Sharing ProRealTime knowledge//---------------------------------------------------------------------------------////-----Inputs----------------------------------------------------------------------//fastlength=12slowlength=26signalLength=9src=closesmasource=1smasignal=1//---------------------------------------------------------------------------------////-----MACD------------------------------------------------------------------------//fastema=average[fastlength,smasource](src)slowema=average[slowlength,smasource](src)mymacd=fastema-slowemasignal=average[signalLength,smasignal](mymacd)histo=mymacd-signal//---------------------------------------------------------------------------------////-----MACD average wave height calculation----------------------------------------//if mymacd crosses over 0 thenactiveWave=1elsif mymacd crosses under 0 thenactiveWave=-1endifif activeWave=1 thencumDnBar=0CumDnMACD=0cumUpBar=cumUpBar+1CumUpMACD=CumUpMACD+mymacdPositiveAverageHeight=CumUpMACD/cumUpBarNegativeAverageHeight=NegativeAverageHeightendifif activeWave=-1 thencumDnBar=cumDnBar+1CumDnMACD=CumDnMACD+mymacdcumUpBar=0CumUpMACD=0PositiveAverageHeight=PositiveAverageHeightNegativeAverageHeight=CumDnMACD/cumDnBarendif//---------------------------------------------------------------------------------//BearishCrossunder = mymacd crosses under signalBullishCrossover = mymacd crosses over signal//---------------------------------------------------------------------------------////---------------------------------------------------------------------------------//crossUnderAboveAvg = BearishCrossunder and mymacd > PositiveAverageHeightcrossAboveBelowAvg = BullishCrossover and mymacd < NegativeAverageHeight//---------------------------------------------------------------------------------////---------------------------------------------------------------------------------//if crossUnderAboveAvg thendrawarrowdown(barindex,signal)coloured("red")elsif crossAboveBelowAvg thendrawarrowup(barindex,signal)coloured("lightgreen")endif//---------------------------------------------------------------------------------////---------------------------------------------------------------------------------//if histo > 0 thenif histo<histo[1] thenr=0g=128b=0elser=50g=205b=50endifelseif histo<histo[1] thenr=255g=0b=0elser=128g=0b=0endifendif//---------------------------------------------------------------------------------//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)07/11/2024 at 1:24 PM #235084 -
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)
Find exclusive trading pro-tools on 
Similar topics: