我刚刚在我的策略中添加了一个简单的 EMA 脚本。问题是当它加载时,颜色 defval 是蓝色的。所以我为每个 ema(慢速和快速)进行了颜色输入,但它不起作用。你知道我在哪里做错了吗?
EMA脚本:
// EMA input
var emacross = "EMA Cross"
ema_01_len = input(20, title='Fast EMA', step=1, type=input.integer, group = emacross)
ema_02_len = input(50, title='Slow EMA', step=1, type=input.integer, group = emacross)
ema_src = input(title="Source", type=input.source, defval=close, group = emacross)
plot_fastEma = input(title="PLot Fast Ema", type=input.bool, defval=false,group=emacross)
plot_slowEma = input(title="PLot Slow Ema", type=input.bool, defval=false,group=emacross)
// EMA def
ema_01 = ema(ema_src, ema_01_len)
ema_02 = ema(ema_src, ema_02_len)
//Plot Emas
plot(plot_fastEma ? ema_01 :an)
plot(plot_slowEma ? ema_02 :an)
// Plot Ema Colors
col_ema01 = input(#2962FF, "Fast EMA", group="Color Settings", inline="EMA FAST",group=emacross)
col_ema02 = input(#FF6D00, "Slow EMA", group="Color Settings", inline="EMA SLOW", group=emacross)
- 还有一种方法可以设置颜色 defval,以便当指示器打开时它会显示特定颜色?(例如:橙色,红色)
谢谢!