使用变色松脚本发出警报
Alert With Color Change Pine Script
我想在 tradingview 上发送颜色变化警报。这是一个名为 Trix 的指标。但是没有警报选项。我尝试添加警报条件但不起作用。
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")*
尝试这样做
alertcondition(out[1] <= out , title="Buy", message="green buy")
alertcondition(out[1] > out , title="Sell", message="red sell")
根据评论添加了一个选项
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")
我想在 tradingview 上发送颜色变化警报。这是一个名为 Trix 的指标。但是没有警报选项。我尝试添加警报条件但不起作用。
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")*
尝试这样做
alertcondition(out[1] <= out , title="Buy", message="green buy")
alertcondition(out[1] > out , title="Sell", message="red sell")
根据评论添加了一个选项
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")