WonderTones

MacD_MT v0.1

MACD multiple time frame TomJones
15, 30, 45, 60, 120, 240 1440 minute curves
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
study(title="MacD_MT", shorttitle="MacD_MT")

//@version=2
var_macd(tframe) =>
    source = close

    fastLength = input(12, minval=1)
    slowLength=input(26,minval=1)
    signalLength=input(9,minval=1)
    
    fastMA = sma(source, fastLength)
    slowMA = sma(source, slowLength)
    
    macd = fastMA - slowMA
    signal = sma(macd, signalLength)
    hist = macd - signal
    
    outMacD = security(tickerid, tframe, macd)
    outDiver = false
    sign = false
    
    [outMacD, outDiver, sign]

upliftval = 0

[m15, diver15, sign15] = var_macd("15")
plot(m15 + upliftval, color=#FF3800, title="MACD")

[m30, diver30, sign30] = var_macd("30")
plot(m30 + upliftval, color=aqua, title="MACD")

[m45, diver45, sign45] = var_macd("45")
plot(m45 + upliftval, color=teal, title="MACD")

[m60, diver60, sign60] = var_macd("60")
plot(m60 + upliftval, color=black, title="MACD")

[m120, diver120, sign120] = var_macd("120")
plot(m120 + upliftval, color=purple, title="MACD")

[m240, diver240, sign240] = var_macd("240")
plot(m240 + upliftval, color=green, title="MACD")

[m1440, diver1440, sign1440] = var_macd("1440")
plot(m1440 + upliftval, color=blue, title="MACD")

plot(upliftval, color=red)