
이 글은 주로 Ravikant_sharma가 개발한 다중 지수 이동 평균 (EMA) 과 상대적으로 강한 지수 (RSI) 를 기반으로 한 정량 거래 전략을 분석합니다. 이 전략은 EMA의 다른 주기와 RSI의 수치를 통해 판단하여 가격 추세를 식별하고 진입 및 출퇴근 시간을 결정합니다.
전략은 9일선, 21일선, 51일선, 100일선, 200일선 등 5개의 다른 주기적인 EMA를 사용한다. 코드에서는 처음 4개의 EMA만 그려져 있다. RSI 파라미트는 14로 설정되어 있다.
다음의 조건 중 하나만 충족하면 전략적으로 더 많은 돈을 벌 수 있습니다.
RSI가 65보다 높으면 상승세를 나타냅니다.
다음의 조건 중 하나만 충족하면 전략 평지출퇴:
이것은 전형적인 트렌드 추적 전략으로 다음과 같은 장점이 있습니다.
이 전략에는 몇 가지 위험도 있습니다.
이 전략은 다음과 같은 방향으로 최적화될 수 있습니다.
이 전략은 전체적으로 신뢰할 수 있고, 실행하기 쉬운 트렌드 추적 전략이다. 그것은 EMA를 다주기 교차하여 트렌드 방향을 결정하고, RSI 필터링 가짜 신호와 결합하여, 재측량 효과의 좋은 기반에 파라미터 최적화 및 모델 최적화를 수행하고, 안정적인 수익을 얻을 수 있다. 그러나 거래자는 사용 할 때, 여전히 경계해야한다.
/*backtest
start: 2024-01-30 00:00:00
end: 2024-02-29 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/
// © Ravikant_sharma
//@version=5
strategy('new', overlay=true)
start = timestamp(1990, 1, 1, 0, 0)
end = timestamp(2043, 12, 12, 23, 59)
ema0 = ta.ema(close, 9)
ema1 = ta.ema(close, 21)
ema2 = ta.ema(close, 51)
ema3 = ta.ema(close, 100)
ema4 = ta.ema(close, 200)
rsi2=ta.rsi(ta.sma(close,14),14)
plot(ema0, '9', color.new(color.green, 0))
plot(ema1, '21', color.new(color.black, 0))
plot(ema2, '51', color.new(color.red, 0))
plot(ema3, '200', color.new(color.blue, 0))
//plot(ema4, '100', color.new(color.gray, 0))
//LongEntry = ( ta.crossover(ema0,ema3) or ta.crossover(ema0,ema2) or ta.crossunder(ema2,ema3) ) // ta.crossover(ema0,ema1) //
LongEntry=false
if ta.crossover(ema0,ema1)
if rsi2>65
LongEntry:=true
if ta.crossover(ema1,ema2)
if rsi2>65
LongEntry:=true
LongExit = ta.crossunder(ema0,ema2) or close >(strategy.position_avg_price*1.25) or rsi2 <40 or close < (strategy.position_avg_price*0.98)
if time >= start and time <= end
if(LongEntry and rsi2>60)
strategy.entry('Long', strategy.long, 1)
if(LongExit)
strategy.close('Long')