我有一些问题,我的文字记录,在我的触发条件后下了两支蜡烛。我的朋友们也有同样的问题。有人知道为什么会这样吗?我能做些什么来解决这个问题?
我的代码(我使用HullMA作为触发器)
/////////////////Trend Indicator/////////////////
malength = input(defval=26, title="Moving Average Length", minval=1)
tsrc = security(heikinashi(syminfo.tickerid),"15", close)
hullma(tsrc, len) =>
hma = wma(2 * wma(tsrc, len / 2) - wma(tsrc, len), round(sqrt(len)))
zlema =hullma(tsrc, malength)
col = zlema > zlema[1] ? color.green : color.red
plot(zlema,color=col, linewidth=4)
/////////////////Buy and Sell Orders/////////////////
//Order conditions
if col == color.green
strategy.entry(id="long", long=true)
if col == color.red
strategy.entry(id="short", long=false)问题:

发布于 2021-05-31 16:22:56
找到解决方案后,笔录等待蜡烛关闭,并没有立即初始化解决方案,因此在初始触发后需要两支蜡烛才能发出信号。
https://stackoverflow.com/questions/67678480
复制相似问题