Graphs slope of ohlc4 MACD

When it =0, trend change

play with slow&fast lengths as well as the length used to calculate the slope.

-in progress(?)

Vertical lines in the image are as close as I could get them to SMACD=0.

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="Slope(MACD(ohlc4))", shorttitle="SMACD")
source = ohlc4
fastLength = input(13, minval=1), slowLength=input(5,minval=1)
fastMA = ema(source, fastLength)
slowMA = ema(source, slowLength)
macd = fastMA - slowMA
//plot(macd, color=blue)
source2 = macd
length = input(1,minval=1)
offset = input(0)
roc = (source2 - source2[length])/source2[length]
plot(roc, color=red, title="MACDROC", offset=offset)
hline(0, title="Zero Line")