다중 요인 양적 거래 전략

저자:차오장, 날짜: 2023-09-13 14:46:59
태그:

다중 요인 양적 거래 전략은 이동 평균 요인과 변동 지표를 통합하여 위험을 제어하고 안정성을 향상시킵니다. 이 문서에서는이 거래 전략의 논리, 장점 및 잠재적 위험을 자세히 설명합니다.

전략 논리

이 전략은 세 가지 주요 모듈으로 구성됩니다.

  1. 이동 평균 요인

트렌드 필터를 구축하기 위해 다른 기간 (8, 13, 21, 34, 55) 을 가진 5 개의 EMA를 사용합니다. MAs는 짧게부터 길게 배치됩니다. 더 빠른 EMA가 느린 EMA를 넘을 때만 트렌드 신호가 생성됩니다.

  1. 오스실레이션 지표

RSI와 스토카스틱 오시레이터를 결합하여 브레이크 아웃 신호를 검증하여 범위 시장에서 과도한 잘못된 브레이크를 피합니다.

RSI (14) 는 40-70 범위에서 긴 신호를 생성하고 30-60 범위에서 짧은 신호를 생성합니다.

스토카스틱 (14,3,3) 은 K 라인이 20-80 사이일 때 긴 신호를 주고, K 라인이 5-95 사이일 때 짧은 신호를 준다.

  1. 진입 및 출입 논리

입력 신호는 두 요소가 정렬되었을 때만 발생하지만 출력 신호는 두 요소 중 하나가 더 이상 유효하지 않을 때 발생합니다.

엄격한 멀티 팩터 필터는 높은 승률과 신뢰할 수 있는 신호를 보장합니다.

장점

  • 다중 요소 설계는 시장 소음을 효과적으로 필터링하고 과도한 거래를 방지합니다.
  • 트렌드 추적과 평균 역전을 결합하여 동적 거래와 위치 거래를 균형있게합니다.
  • MA와 오시레이터를 사용하여 트렌드 내의 반전 지점을 캡처합니다.
  • 더 나은 성능을 얻기 위해 큰 최적화 공간.

위험성

  • 상대적으로 낮은 신호 주파수, 몇 가지 기회를 놓칠 수 있습니다.
  • MA 지연은 더 빠른 오시레이터로 확인되어야 합니다.
  • 잘못된 신호에 취약한 오시레이터는 보조 요소로 사용되어야 합니다.
  • 매개 변수는 변화하는 시장 조건에 적응하기 위해 주기적으로 최적화되어야합니다.

결론

이 전략은 트렌드 추종 및 역전 거래 전략의 장점을 성공적으로 결합합니다. 다중 요인 리스크 제어 모델은 안정적인 알파를 제공합니다. AI 커뮤니티에 의해 심도 있는 연구와 응용을 가치가있는 매우 실용적인 양적 거래 전략입니다.


/*backtest
start: 2022-09-12 00:00:00
end: 2022-11-15 00:00:00
period: 2d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=3
strategy(title = "Combined Strategy", default_qty_type = strategy.percent_of_equity, default_qty_value = 100, commission_type=strategy.commission.percent, commission_value = .0020, pyramiding = 0, slippage = 3, overlay = true)

//----------//
// MOMENTUM //
//----------//
ema8 = ema(close, 8)
ema13 = ema(close, 13)
ema21 = ema(close, 21)
ema34 = ema(close, 34)
ema55 = ema(close, 55)

plot(ema8, color=red, style=line, title="8", linewidth=1)
plot(ema13, color=orange, style=line, title="13", linewidth=1)
plot(ema21, color=yellow, style=line, title="21", linewidth=1)
plot(ema34, color=aqua, style=line, title="34", linewidth=1)
plot(ema55, color=lime, style=line, title="55", linewidth=1)

longEmaCondition = ema8 > ema13 and ema13 > ema21 and ema21 > ema34 and ema34 > ema55
exitLongEmaCondition = ema13 < ema55

shortEmaCondition = ema8 < ema13 and ema13 < ema21 and ema21 < ema34 and ema34 < ema55
exitShortEmaCondition = ema13 > ema55

// ----------  //
// OSCILLATORS //
// ----------- //
rsi = rsi(close, 14)
longRsiCondition = rsi < 70 and rsi > 40
exitLongRsiCondition = rsi > 70

shortRsiCondition = rsi > 30 and rsi < 60
exitShortRsiCondition = rsi < 30

// Stochastic
length = 14, smoothK = 3, smoothD = 3
kFast = stoch(close, high, low, 14)
dSlow = sma(kFast, smoothD)

longStochasticCondition = kFast < 80
exitLongStochasticCondition = kFast > 95

shortStochasticCondition = kFast > 20
exitShortStochasticCondition = kFast < 5

//----------//
// STRATEGY //
//----------//

longCondition = longEmaCondition and longRsiCondition and longStochasticCondition and strategy.position_size == 0
exitLongCondition = (exitLongEmaCondition or exitLongRsiCondition or exitLongStochasticCondition) and strategy.position_size > 0

if (longCondition)
    strategy.entry("LONG", strategy.long)
if (exitLongCondition)
    strategy.close("LONG")
    
shortCondition = shortEmaCondition and shortRsiCondition and shortStochasticCondition and strategy.position_size == 0
exitShortCondition = (exitShortEmaCondition or exitShortRsiCondition or exitShortStochasticCondition) and strategy.position_size < 0

if (shortCondition)
    strategy.entry("SHORT", strategy.short)
if (exitShortCondition)
    strategy.close("SHORT")

더 많은