0

与 SMA 交叉策略相反,我正在寻找价格 SMA 交叉策略。

换句话说:

如果价格 > SMA -> 买入

如果价格 < SMA -> 卖出。

如果有人帮助我如何调整以下代码,我将非常高兴。

longCondition = crossover(sma(open , 1), sma(close, 25)) 

if (inDateRange and longCondition)
    strategy.entry(id="EL", long=true)

 
exitLong = crossunder(sma(open, 1), sma(open, 25)) 
strategy.close(id="EL", when=exitLong)
4

0 回答 0