当 RSI(在特定时间范围内)超过 30 时,是否可以做多?目标是最终在一种策略中使用多个 RSI 时间框架。
我知道 security() 函数在绘图时在研究中起作用,但我还没有找到任何人们在策略中使用它的例子......
我的代码如下。它不进行任何交易。
//@version=3
strategy("RSI 5minutes", initial_capital=100000)
rsi5m = security(ticker,"5",rsi(close,14))
co = crossover(rsi5m, 30)
if(strategy.opentrades == 0 and co and not(na(rsi5m)))
strategy.entry("buy1", long=true, limit=1, qty=100)