我尝试根据以下策略生成的信号绘制图表。但我从脚本中观察到的是蜡烛的信号产生点不同。如果有人知道这一点,请帮助我。作为参考,我附上了下面的快照
1. 买入信号快照 https://i.stack.imgur.com/RLtoP.png
2. 卖出信号快照 https://i.stack.imgur.com/TNXyu.png
//@version=4
strategy("My Strategy", overlay=true)
orderType = 0
longCondition = crossover(sma(close, 14), sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
orderType := 1
shortCondition = crossunder(sma(close, 14), sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
orderType := -1
plot(orderType,"OrderType",color.black)
//@version=4
strategy("My Strategy", overlay=true, process_orders_on_close=true)
orderType = 0
longCondition = crossover(sma(close, 14), sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long)
orderType := 1
shortCondition = crossunder(sma(close, 14), sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short)
orderType := -1
plot(orderType,"OrderType",color.black)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)