如何解决Pinescript 2 对 pinescript 连接器的警报,我的不可能完成的任务
我在过去 2 天里尝试向 Pine 连接器的 pine script2 指示器添加 2 个警报。 YouTube 和 google dot 对我有用,或者我没有找到合适的网站,我在你的网站上尝试了一些东西,但我没有完成。策略测试器工作正常。
我需要在警报中显示此消息。
"alert("LICENSEID,sell,"+syminfo.ticker+",risk=0.10",alert.freq_once_per_bar_close)"
我所缺少的不是那么困难,我从另一个指标复制了工作字符串并尝试了“警报条件(条件,标题,消息)”
这不起作用
//Strategy
golong = crossover(fma,sma)
goshort = crossunder(fma,sma)
if (golong)
strategy.entry("My Long Entry Id",strategy.long)
alert("5406404411575,buy,alert.freq_once_per_bar_close)
if (goshort)
strategy.entry("My Short Entry Id",strategy.short)
alert("5406404411575,risk=1",alert.freq_once_per_bar_close)
我在 TV 和 Pinescript 方面很新,所以请有人帮忙吗? 约翰尼
"这是原始代码。"
//@version=2
//Heikin/Kaufman by Marco
strategy("Heikin/Kaufman Strategy
",shorttitle="HAS/KAU",overlay=true,max_bars_back=500,default_qty_value=1000,initial_capital=100000,currency=currency.EUR)
res1 = input(title="Heikin Ashi EMA Time Frame",type=resolution,defval="D")
test = input(0,"Heikin Ashi EMA Shift")
sloma = input(20,"Slow EMA Period")
//Kaufman MA
Length = input(5,minval=1)
xPrice = input(hlc3)
xvnoise = abs(xPrice - xPrice[1])
Fastend = input(2.5,step=.5)
Slowend = input(20)
nfastend = 2/(Fastend + 1)
nslowend = 2/(Slowend + 1)
nsignal = abs(xPrice - xPrice[Length])
nnoise = sum(xvnoise,Length)
nefratio = iff(nnoise != 0,nsignal / nnoise,0)
nsmooth = pow(nefratio * (nfastend - nslowend) + nslowend,2)
nAMA = nz(nAMA[1]) + nsmooth * (xPrice - nz(nAMA[1]))
//Heikin Ashi Open/Close Price
ha_t = heikinashi(tickerid)
ha_close = security(ha_t,period,nAMA)
mha_close = security(ha_t,res1,hlc3)
//Moving Average
fma = ema(mha_close[test],1)
sma = ema(ha_close,sloma)
plot(fma,title="MA",color=black,linewidth=2,style=line)
plot(sma,title="SMA",color=red,style=line)
//Strategy
golong = crossover(fma,strategy.long)
if (goshort)
strategy.entry("My Short Entry Id",strategy.short)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。