이 전략은 다중 이동 평균과 RSI 지표의 조합 거래를 사용합니다. 빠른 EMA 아래에서 느린 EMA를 통과하고 RSI가 초과 판매를 표시 할 때 공백; 가격이 다시 평균선을 통과 할 때 평점.
구체적인 거래 논리:
9일, 26일, 100일, 55일 평균과 같은 4개의 다른 기간의 지수 이동 평균을 계산합니다.
9일 EMA 아래에서 26일 EMA를 통과할 때, 공백 신호를 고려하십시오.
동시에, RSI 지표가 하위값 (예: 40) 보다 낮으면 하위 신호를 활성화하여 과매매 반동을 피합니다.
진입이 공백된 후, 가격이 55일 또는 100일 EMA를 통과했을 때 공백된 포지션
다양한 평선 주기 조합을 설정할 수 있으며, 최적화 매개 변수
이 전략은 다중평균선 판단 경향을 최대한 활용하고 RSI 지표가 오버셀 포인트에서 공백을 취하는 가짜 신호를 필터링하는 데 도움을줍니다.
다중평균형 조합 판단, 정확성 향상
RSI 지표가 과매매 반동 위험을 피합니다.
짧은 평균선으로 전략, 긴 평균선으로 중지 손실, 회수 제어
적절한 매개 변수를 결정하기 위해 반복 테스트가 필요합니다.
RSI 변수 설정은 신중하게 평가해야 합니다.
“이런 전략으로 많은 기회를 놓칠 수 있다”.
이 전략은 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")