我想转换TradingView松树脚本“价格通道策略”以在触发买,卖或tsl信号时创建警报。有人可以帮忙吗?
代码如下:
//@version=4
strategy("Price Channel Strategy", overlay=true)
length = input(20)
hh = highest(high, length)
ll = lowest(low, length)
if (not na(close[length]))
strategy.entry("PChLE", strategy.long, comment="PChLE", stop=hh)
strategy.entry("PChSE", strategy.short, comment="PChSE", stop=ll)
strategy.exit("long tsl","PChLE", trail_points = 5000, trail_offset=2000)
strategy.exit("short tsl","PChSE", trail_points = 5000, trail_offset=2000)
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)
答案 0 :(得分:0)
我不认为alertcondition
脚本中可以使用strategy
自定义警报。
您可能必须将strategy
转换为study
才能创建自定义警报。