vkno422

4 colour MACD with signal line

806 8 220
This is the same as the MACD 4C but it also has the signal line.
Remove from Favorite Scripts Add to Favorite Scripts
study(shorttitle = "MACD 4CS", title = "4 colour MACD with signal line")
fastMA = input(title="Fast moving average", type = integer, defval = 12, minval = 7)
slowMA = input(title="Slow moving average", type = integer, defval = 26, minval = 7)
signalIn = input(title="Signal period", type = integer, defval = 9, minval = 3)
lastColor = yellow
[currMacd,currSignal,_] = macd(close[0], fastMA, slowMA, signalIn)
[prevMacd,prevSignal,_] = macd(close[1], fastMA, slowMA, signalIn)
plotColor = currMacd > 0 
    ? currMacd > prevMacd ? lime : green 
    : currMacd < prevMacd ? maroon : red
plot(currMacd, style = histogram, color = plotColor, linewidth = 3)
plot(currSignal, style = line, color = aqua, linewidth = 1)
plot(0, title = "Zero line", linewidth = 1, color = gray)
pippo
2 years ago
Great, was waiting for it.
+1 Reply
diamondekk
2 years ago
thanks a lot.
+1 Reply
ski4ever PRO
2 years ago
Very nice - thanks, Victor!
+1 Reply
mac019
2 years ago
This is very nice, thank you
Reply
Thanks!
Reply
jacobtrading68
a year ago
Thanks Victor!
Reply
JoseNeto PRO
3 months ago
Amazing, Thanks Victor!!!!!
Reply
Tim8917 PRO
2 months ago
Thanks Victor!
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener 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