价格-SMA交叉策略

时间:2021-03-15 12:15:03

标签: editor crossover

与 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)

0 个答案:

没有答案