동력 지표 크로스오버 전략

저자:차오장, 날짜: 2023-12-27 17:04:33
태그:

img

전반적인 설명

모멘텀 인디케이터 크로스오버 전략 (Momentum Indicator Crossover Strategy) 은 기하급수적인 이동 평균 (EMA) 및 상대적 강도 지수 (RSI) 신호의 조합을 기반으로 한 거래 접근법이다. 두 개의 EMA 라인의 크로스오버를 기반으로 한 구매 및 판매 신호를 활용하도록 설계된 이 전략은 금융 시장에서 거래를 관리하는 데 단순성과 효율성을 제공합니다.

전략 원칙

이 전략의 핵심은 빠른 EMA 라인 및 느린 EMA 라인의 크로스오버 시스템입니다. 전략은 다른 매개 변수와 함께 세 개의 EMA 라인을 정의합니다.ema1, ema2그리고ema3그 중에는ema1단기적인 경향을 나타냅니다.ema2중장기 경향을 나타냅니다.ema3장기 트렌드를 나타냅니다. 단기 트렌드가 중장기 트렌드를 넘을 때 구매 신호가 생성됩니다. 단기 트렌드가 중장기 트렌드 아래로 떨어지면 판매 신호가 생성됩니다.

잘못된 신호를 필터링하기 위해 전략은 또한 두 가지 추가 조건을 정의합니다.bodybar1 > bodybar2그리고close > entrybar(구매 신호) 또는close < entrybar이것은 최근 두 개의 촛불이 신호의 방향을 충족하고 가격이 부재된 입력을 피하기 위해 입점점을 통과하는 것을 보장합니다.

또한, 전략은 과잉 구매 및 과잉 판매 조건을 평가하기 위해 RSI 지표를 포함합니다. RSI의 과잉 구매 영역은 과도한 구매 신호를 정의하는 데 사용되며, 과잉 판매 영역은 과도한 판매 신호를 정의하는 데 사용됩니다. 이것은 과열 및 과냉 시장에서 잘못된 신호를 피하는 데 도움이됩니다.

이점 분석

이 전략의 장점은 다음과 같습니다.

  1. 간단하고 사용하기 쉽다. 사용자는 복잡한 지표를 이해 할 필요가 없습니다.
  2. 투자된 자본의 비율에 기초한 유연한 포지션 크기
  3. RSI 필터와 결합된 EMA 크로스오버는 신호 신뢰성을 향상시킵니다.
  4. 명확한 거래 논리, 이해하기 쉽고 조정하기 쉽습니다.

위험 분석

이 전략의 위험은 다음과 같습니다.

  1. EMA 크로스오버는 시장 소음을 완전히 필터링할 수 없으며 잘못된 신호를 쉽게 생성할 수 있습니다.
  2. 고정 매개 변수 EMA 라인은 실시간 시장 변화에 적응할 수 없습니다.
  3. 스톱 손실 논리는 단일 손실을 제어할 수 없습니다.
  4. RSI 필터 조건이 너무 간단해서 기회를 놓칠 수도 있습니다.

최적화 방향

이 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.

  1. 시장 변동성 및 거래 상품에 기반한 적응 가능한 EMA 매개 변수를 설정하여 매개 변수 시기를 개선합니다.
  2. MACD, 볼링거 밴드 등과 같은 여러 필터를 통합하여 잘못된 신호를 줄이십시오.
  3. 트레이킹 스톱 로스를 추가하고, 수익 기능을 취해서 거래 위험을 제어합니다.
  4. RSI 필터 논리를 최적화하여 전체 전략 안정성을 향상시킵니다.
  5. 기계 학습 기술을 통해 전략 매개 변수를 동적으로 최적화합니다.

결론

모멘텀 인디케이터 크로스오버 전략은 EMA와 RSI의 강점을 통합하여 인디케이터 크로스오버를 기반으로 거래 신호를 형성합니다. 전략은 간단하고 실용적이며 초보자에게 적합하며 전략 성능을 향상시키기 위해 실제 필요에 따라 확장 및 최적화 될 수 있습니다. 엄격한 위험 관리로 전략은 안정적인 초과 수익을 약속합니다.


/*backtest
start: 2022-12-20 00:00:00
end: 2023-12-26 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=5
strategy('EMA Crossover Strategy', shorttitle='EMA Crossover', overlay=true)


// Define input for position size as a percentage of equity
position_size_pct = input(1, title='Position Size (%)') / 100

//Input EMA
len1 = input.int(25, minval=1, title='EMA 1')
src1 = input(close, title='Source')
ema1 = ta.ema(src1, len1)
len2 = input.int(100, minval=1, title='EMA 2')
src2 = input(close, title='Source')
ema2 = ta.ema(src2, len2)
len3 = input.int(200, minval=1, title='EMA 3')
src3 = input(close, title='Source')
ema3 = ta.ema(src3, len3)
//End of format

//Format RSI
lenrsi = input(14, title='RSI length')
outrsi = ta.rsi(close,lenrsi)
//plot(outrsi, title='RSI', color=color.new(color.blue, 0), linewidth=1)

//hline(70, 'Overbought', color=color.red)
//hline(30, 'Oversold', color=color.green)
//End of format


bodybar1 = math.abs(close - open)
bodybar2 = math.abs(close[1] - open[1])
// Plot the EMAs
plot(ema1, color=color.new(color.blue, 0), title='EMA 1')
plot(ema2, color=color.new(color.red, 0), title='EMA 2')
//plot(ema3, color=color.new(#ffffff, 0), title='EMA 3')

// EMA Crossover conditions
emaCrossoverUp = ta.crossover(ema1, ema2)
emaCrossoverDown = ta.crossunder(ema1, ema2)

var entrybar = close  // Initialize entrybar with the current close


// Calculate crossovers outside of the if statements
emaCrossoverUpOccured = ta.crossover(close, ema1) and ema1 > ema2 and bodybar1 > bodybar2 and close > entrybar
emaCrossoverDownOccured = ta.crossunder(close, ema1) and ema1 < ema2 and bodybar1 > bodybar2 and close < entrybar

plotshape(series=emaCrossoverUpOccured, location=location.abovebar, color=color.new(color.green, 0), style=shape.triangleup, title='New Buy Order', size=size.tiny)
plotshape(series=emaCrossoverDownOccured, location=location.belowbar, color=color.new(color.red, 0), style=shape.triangledown, title='New Sell Order', size=size.tiny)

// Define trading logic with custom position size and RSI conditions
if emaCrossoverUp or emaCrossoverUpOccured
    strategy.entry('Buy', strategy.long)
    entrybar := close  // Update entrybar when entering a new buy position
    entrybar

if emaCrossoverDown or emaCrossoverDownOccured
    strategy.entry('Sell', strategy.short)
    entrybar := close  // Update entrybar when entering a new sell position
    entrybar



더 많은