[英]Alert With Color Change Pine Script
I want to send alert on tradingview with color change.我想在交易视图上发送带有颜色变化的警报。 This is an indicator named Trix.
这是一个名为 Trix 的指标。 But dont have alert options.
但没有警报选项。 i try to add alert condition but dont work.
我尝试添加警报条件但不起作用。
study(title="TRIX (Custom)", shorttitle="TRIX (Custom)")
length = input(6, minval=1)
out = 10000* change(ema(ema(ema(log(close), length), length), length))
upColour = #33CC33
downColour = #FF5555
hline(0, title="Zero")
plot(out, color = out[1] > out ? downColour : upColour)
*alertcondition(upColour, title="Buy", message="green buy")
alertcondition(downColour, title="Sell", message="red sell")*
Try to do this尝试这样做
alertcondition(out[1] <= out , title="Buy", message="green buy")
alertcondition(out[1] > out , title="Sell", message="red sell")
added an option based on the comment根据评论添加了一个选项
alertcondition(out[2] > out[1] and out[1] <= out , title="Buy", message="green buy")
alertcondition(out[2] <= out[1] and out[1] > out , title="Sell", message="red sell")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.