我的代码没有显示任何错误,但是当我尝试启动它时,没有提供任何条目,除此之外,我还想添加几个额外的过滤器:
- RSI >50(做多时)
- SlowEMA > SMA(做多时)
- 关闭 > SlowEMA(做多时)
有什么建议么?
FastEMA = ema(close,9) // EMA Fast 9 periods
plot(FastEMA,color=color.fuchsia)
SlowEMA = ema(close,26) // EMA Slow 26 periods
plot(SlowEMA,color=color.blue)
plot(sma(close,200),color=color.gray) // SMA 200 periods
rsi = rsi(close, 14) // Relative strength index
// Donchian Channel
length = input(20, minval=1)
lower = lowest(length)
upper = highest(length)
basis = avg(upper, lower)
u = plot(upper, "Upper", color=#FF9400)
l = plot(lower, "Lower", color=#FF9400)
// Specify crossover conditions
longCondition = crossover(FastEMA, SlowEMA)
shortCondition = crossunder(FastEMA, SlowEMA)
// Execution
if (longCondition)
strategy.entry("long", strategy.long, 100)