pine-script - 带有颜色变化松树脚本的警报
问题描述
我想在交易视图上发送带有颜色变化的警报。这是一个名为 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")
推荐阅读
- postman - 某些语言在邮递员中不可用;有没有办法启用它?
- mysql - 不应该返回任何东西的 MySQL 查询,返回一条记录
- java - 什么时候可以增加 jvm (-Xss) 的最大堆栈大小?
- c++ - 不能将结构分配给向量的索引吗?
- twilio - 在房间里从拨号盘收集数字
- bash - 如果“特定”列的行匹配,则比较“特定”列的行并连接其他列
- c# - Selenium 问题关闭弹出窗口
- flutter - 覆盖 operator== 是否有助于避免重建?
- python - 如何在 Python 中结合以下理解?
- python - 如何在 docker(Azure Web App)中为 Python 导入 cv2?