Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © Maurizio-Ciullo
- //@version=5
- indicator("Study Macd", overlay=false)
- i_price_src = input.source(title="Price Source", defval=close, group="g_macd")
- i_fast_length = input.int(title="Fast Length", defval=12, group="g_macd")
- i_slow_length = input.int(title="Slow Length", defval=26, group="g_macd")
- i_signal_length = input.int(title="Signal Smoothing", minval=1, maxval=50, defval=9, group="g_macd")
- // Calculate MACD
- [macdLine, signalLine, histLine] = ta.macd(i_price_src, i_fast_length, i_slow_length, i_signal_length)
- plot(macdLine, color=#2962FF)
- plot(signalLine, color=#FF6D00)
- plot(histLine, title="Histogram", style=plot.style_columns, color=(histLine>=0 ? (histLine[1] < histLine ? #26A69A : #B2DFDB) : (histLine[1] < histLine ? #FFCDD2 : #FF5252)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement