이 전략은 MACD와 RSI가 결합된 외동시장 거래 전략이라고 불린다. 이 전략은 최근 확장된 암호화폐 외동 시장을 위해 특별히 설계되었으며, 트렌드 지표 MACD와 동력 지표 RSI를 결합하여 거래 신호를 형성한다.
MACD는 지수 이동 평균 차치 값으로, 시장의 추세와 추세 반전을 판단할 수 있다. MACD의 빠른 라인 상에서 느린 라인을 통과하면 구매 신호가 발생하고, 빠른 라인 아래에서 느린 라인을 통과하면 판매 신호가 발생한다.
RSI는 상대적으로 강한 지수로서 시장의 과매매를 판단한다. RSI가 50보다 높으면 과매매를 나타내고, 50보다 낮으면 과매매를 나타냅니다. 이 전략은 RSI 지표를 사용하여 MACD 지표에서 발생하는 일부 잡음 신호를 필터링한다.
구체적인 거래 전략은 다음과 같습니다.
MACD의 빠른 선에서 느린 선을 통과하면, 단기 트렌드가 하향으로 전환되는 것을 나타냅니다. 그러나 RSI의 낮은 지점 (예정값보다 낮은 지점) 에서 구매 신호를 확인해야 합니다.
MACD가 빠른 라인 아래에서 느린 라인을 통과하면, 단기 트렌드가 ?? 으로 내려가지만, RSI 고위 (예정값보다 높다) 에서 판매 신호를 확인해야 하며, 초매 지역에서의 반전 손실을 피한다.
이 전략은 최근에 개발된 암호화폐 수평 변동 시장에 적용되며, 높은 낮은 반전 기회를 잡아서 이익을 얻습니다. 그러나 단독 손실을 제한하기 위해 손해 방지 조치를 취해야합니다. 또한, MACD 및 RSI 파라미터는 시장에 따라 조정되어야 신뢰성있는 거래 신호를 생성합니다.
전반적으로, MACD와 RSI 지표의 통합 사용은, 흔들리는 시장을 정리하는 거래 전략의 효과를 향상시킬 수 있습니다. 그러나 어떤 기술 지표도 완벽하게 시장을 예측 할 수 없습니다. 거래자는 시장 추세에 대한 판단을 유지하고, 전략을 조정하는 데 유연해야합니다.
/*backtest
start: 2022-09-06 00:00:00
end: 2023-03-11 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Range Strat - MACD/RSI",
overlay=true,
default_qty_type=strategy.percent_of_equity,
default_qty_value=100, precision=2, initial_capital=100,
pyramiding=2,
commission_value=0.05)
// Make input options that configure backtest date range
startDate = input(title="Start Date", defval=13)
startMonth = input(title="Start Month", defval=6)
startYear = input(title="Start Year", defval=2022)
endDate = input(title="End Date", defval=1)
endMonth = input(title="End Month", defval=7)
endYear = input(title="End Year", defval=2200)
// Look if the close time of the current bar
// falls inside the date range
inDateRange = (time >= timestamp(syminfo.timezone, startYear,
startMonth, startDate, 0, 0)) and
(time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0))
// RSI Settings
length = input( 14 )
overSold = input( 55 )
overBought = input( 50 )
price = open
vrsi = ta.rsi(price, length)
cu = (vrsi <= overSold)
co = (vrsi >= overBought)
//MACD Settings
fastLength = input(12)
slowlength = input(26)
MACDLength = input(9)
MACD = ta.ema(open, fastLength) - ta.ema(open, slowlength)
aMACD = ta.ema(MACD, MACDLength)
delta = MACD - aMACD
MACDco = ta.crossover(delta, 0)
MACDcu = ta.crossunder(delta, 0)
// Strategy Entry
if (not na(vrsi))
if (inDateRange and MACDco and cu)
strategy.entry("LONG", strategy.long, comment="LONG")
if (inDateRange and MACDcu and co)
strategy.entry("SHORT", strategy.short, comment="SHORT")
//plot(strategy.equity, title="equity", color=color.red, linewidth=2, style=plot.style_areabr)