NADFULL-MACDU
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © qq182004797
//@version=5
//变色MACD（附图指标）
indicator("NADFULL-MACDU")//指标名称
[macdLine, signalLine, histLine] = ta.macd(close, 12, 26, 9)//12,26,9是MACD参数

//显示MACD指标
float macd=macdLine-signalLine
plot(macdLine, "DIFF", ta.rising(macdLine, 1) ? #FF0000 : #ffffff, 5)//DIFF的颜色及粗细
plot(signalLine, "DEA", ta.rising(signalLine, 1) ? #FF0000 : #ffffff, 1)//DEA的颜色及粗细
plot(macd>0?macd:0, "MACD", ta.rising(macd, 1) ? #ff0080 : #00ffff, 4, style = plot.style_histogram)//0轴之上MACD柱子的颜色及粗细
plot(macd<0?macd:0, "MACD", ta.rising(macd, 1) ? #ffff00 : #008000, 4, style = plot.style_histogram)//0轴之下MACD柱子的颜色及粗细