다중 EMA 이동 RSI 전략

저자:차오장, 날짜: 2023-09-14 16:28:04
태그:

전략 논리

이 전략은 여러 이동 평균을 RSI와 결합하여 거래합니다. 더 빠른 EMA가 더 느린 EMA 아래로 넘어가면 RSI가 과잉 판매로 확인되면 짧습니다.

논리는 다음과 같습니다.

  1. 다른 기간의 4개의 EMA를 계산합니다. 예를 들어 9, 26, 100 및 55 기간

  2. 9주기 EMA가 26주기 EMA보다 낮을 때 단축 신호가 발사됩니다.

  3. 소매 부진을 피하기 위해 RSI가 임계치 (예를 들어 40) 이하인 경우에만 단축을 활성화합니다.

  4. 짧은 진입 후, 가격이 55 또는 100 EMA를 넘을 때 출입

  5. 매개 변수 최적화를 위해 다른 EMA 조합을 설정할 수 있습니다.

이 전략은 트렌드를 위해 여러 EMA를 활용하고 신호 확인을 위해 RSI를 추가하여 과판 수준에서 단축합니다.

장점

  • 다중 EMA는 정확성을 향상시킵니다.

  • RSI는 과잉 판매 반향 위험을 피합니다.

  • 엔트리에 대한 더 빠른 EMA, 스톱 손실에 대한 더 느린

위험성

  • 최적의 매개 변수를 찾기 위해 광범위한 테스트가 필요합니다.

  • RSI 매개 변수들에 대한 신중한 평가

  • 짧은 시간, 너무 긴 시간, 놓친 기회

요약

이 전략은 여러 EMA의 힘을 RSI 확인과 필터링과 결합합니다. 매개 변수 최적화 및 스톱 손실은 중요합니다. 그러나 단축이 중요한 한계입니다.


/*backtest
start: 2023-08-14 00:00:00
end: 2023-09-13 00:00:00
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © YukalMoon

//@version=5
strategy(title="EMA SCALPEUR", overlay=true, initial_capital = 1000)


//// input controls

EMA_L = input.int (title = "EMA_L", defval = 9, minval = 1, maxval = 100, step =1)
EMA_L2 = input.int (title = "EMA_L2", defval = 26, minval = 1, maxval = 100, step =1)
EMA_S = input.int (title = "EMA_S", defval = 100, minval = 1, maxval = 100, step =1)
EMA_S2 = input.int (title = "EMA_S2", defval = 55, minval = 1, maxval = 100, step =1)
RSI1 = input.int (title = "RSI", defval = 5, minval = 1, maxval = 20 , step = 1)

/// mise en place de ema

RSI = ta.rsi(close, RSI1)

shortest = ta.ema(close, 9)
short = ta.ema(close, 26)
longer = ta.ema(close, 100)
longest = ta.ema(close, 55)

plot(shortest, color = color.red)
plot(short, color = color.orange)
plot(longer, color = color.aqua)
plot(longest, color = color.yellow)

plot(close)

//// trading indicators

EMA1 = ta.ema (close,EMA_L)
EMA2 = ta.ema (close,EMA_L2)
EMA3 = ta.ema (close, EMA_S)
EMA4 = ta.ema (close, EMA_S2)


//buy = ta.crossover(EMA1, EMA2) and RSI > 60 and RSI <70
sell = ta.crossunder(EMA1, EMA2) and RSI > 40

//buyexit = ta.crossunder(EMA3, EMA4)
sellexit = ta.crossover(EMA3, EMA4)

/////strategy


strategy.entry ("short", strategy.short, when = sell, comment = "ENTER-SHORT")


///// market exit


strategy.close ("short",  when = sellexit, comment = "EXIT-SHORT")













더 많은