vkno422

MACD 4C

9374 24 2956
4 Coloured MACD
lime = positive rising
green = positive descending
red = positive rising
maroon = positive descending
Remove from Favorite Scripts Add to Favorite Scripts
study(shorttitle = "MACD 4C", title = "4 colour MACD")
fastMA = input(title="Fast moving average", type = integer, defval = 12, minval = 7)
slowMA = input(title="Slow moving average", type = integer, defval = 26, minval = 7)
lastColor = yellow
[currMacd,_,_] = macd(close[0], fastMA, slowMA, 9)
[prevMacd,_,_] = macd(close[1], fastMA, slowMA, 9)
plotColor = currMacd > 0 
    ? currMacd > prevMacd ? lime : green 
    : currMacd < prevMacd ? maroon : red
plot(currMacd, style = histogram, color = plotColor, linewidth = 3)
plot(0, title = "Zero line", linewidth = 1, color = gray)
Copied and pasted the script into the script editor.
Save, and Add to Chart - voilà!
Thanks Victor!
+3 Reply
Thanks Victor!
+1 Reply
I love using MACD. This usage is the closest direct correlation to price/candle changes.
Reply
To get the script add it to your favorite sripts by clicking the star next to the script. It should then show blue.
Then click on "indicators" above your chart (you need to click on the word rather than the arrow next to it).
You will see a group on the left called "favorites". The MACD 4C should show in there. Just click on it to add it to the chart.
+1 Reply
BWilliam vkno422
Thanks Vic... I finally got it to work.
+1 Reply
Thank you Victor
+2 Reply
Thank you Victor, MACD added
Reply
Thanks Victor!
Reply
Why does the MACD differs from standard MACD (try with the one by default) ?

I don't get it by looking the code.
Reply
Kantardziski PRO J.Livermore
I cant tell either.
Reply
Kantardziski PRO Kantardziski
Well actually, it is something to do with the portion of script changing the colors of macd... Take that out and it performs normally.
Reply
Kantardziski PRO Kantardziski
As a prudent person, it is difficult to think nearly 1000 likes and this has slipped by ever user... in other words, its certainly possible I am missing something.
Reply
vkno422 PRO J.Livermore
It's very simple really. In most MACD's the MACD value is shown as a line, here it is the MACD value that is shown as a histogram.
Reply
Thank you very much sir . I got it!!!!
Reply
Tnx.
Reply
Good Job
Reply
Thanks Victor
Reply
How do I get this indicator in my MT4 platform ?
Reply
@Joe_555, There are different MACD's available for MT4.
This is specifically written for TradingView and uses their scripting language (PineScript).
So this specific version is not available for MT4.
Reply
Joe_555 vkno422
@vkno422, I manage to download Histogram MACD indicator for MT4 and the settings are 12, 26,9 (similar to your settings) , but it look very different from how it appears in TradingView. Any reason why? or is there any setting that I got it wrong, appreciate your feedback
Reply
@Joe_555, Most likely it is that I am showing the MACD as histogram. Most MACD's show the MACD as a line.
Reply
Thanks,
Alternatively, Click on indicators and type MACD 4C, it will pop up and Click on it, and done you have it on your chart.
Reply
mashiledr TheFXtradingToolz
@TheFXtradingToolz, im failing to get macd 4c
Reply
United States
United Kingdom
India
España
France
Italia
Polska
Brasil
Россия
Türkiye
Indonesia
日本
한국
Home Stock Screener Forex Signal Finder Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out