
이 전략은 “RSI50_EMA 장점 전략”이라고 불리며, 주요 아이디어는 상대적으로 강한 지수 ((RSI) 와 지수 이동 평균 ((EMA) 의 두 가지 기술 지표의 교차 신호를 사용하여 거래 결정을 내리는 것입니다. 가격이 아래에서 위로 EMA 상도를 돌파하고 RSI가 50 이상일 때 장점을 열고, 가격이 위에서 아래로 EMA 하도를 돌파하거나 RSI가 50 평점을 넘어설 때 장점을 열습니다. 이 전략은 더 많이하고, 공백하지 않고, 추적 전략입니다.
RSI50_EMA 장거리 전략은 RSI와 EMA를 기반으로 한 간단하고 사용하기 쉬운 트렌드 추적 전략으로, 단방향 상승 상황에서 사용하기에 적합하다. 이 전략의 논리는 명확하고 장점은 분명하지만, 일부 결점과 위험도 존재한다. 더 많은 보조 지표, 최적화 매개 변수, 위험 제어 개선 등의 조치를 도입함으로써 이 전략의 안정성과 수익성을 더욱 향상시킬 수 있다. 그러나 실제 적용에서는 시장 특성, 개인 위험 선호 등의 요인에 따라 유연하게 조정 및 개선해야 한다.
/*backtest
start: 2023-05-05 00:00:00
end: 2024-05-10 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("RSI50_EMA Long Only Strategy", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
len = input(11, type=input.integer, minval=1, title="Length")
mul = input(2, type=input.float, minval=0, title="Multiplier")
rsicap = input(50, type=input.integer, minval=1, title="rsicap")
rsi_1 = rsi(close,20)
price = sma(close, 2)
average = ema(close, len)
diff = atr(len) * mul
bull_level = average + diff
bear_level = average - diff
bull_cross = crossover(price, bull_level)
RENTRY = crossover(rsi_1,rsicap)
bear_cross = crossover(bear_level, price)
EXIT = crossunder(rsi_1,50)
strategy.entry("Buy", strategy.long, when=bull_cross)
strategy.close("Buy", when=bear_cross) //strategy.entry("Sell", strategy.short, when=bear_cross)
if (RENTRY)
strategy.entry("RSI", strategy.long, when=bull_cross)
if (EXIT)
strategy.close("RSICLose", when=bull_cross) //strategy.entry("Sell", strategy.short, when=bear_cross)
plot(price, title="price", color=color.black, transp=50, linewidth=2)
a0 = plot(average, title="average", color=color.red, transp=50, linewidth=1)
a1 = plot(bull_level, title="bull", color=color.green, transp=50, linewidth=1)
a2 = plot(bear_level, title="bear", color=color.red, transp=50, linewidth=1)
fill(a0, a1, color=color.green, transp=97)
fill(a0, a2, color=color.red, transp=97)