다중 요인 양적 거래 전략


생성 날짜: 2023-09-13 14:46:59 마지막으로 수정됨: 2023-09-13 14:46:59
복사: 0 클릭수: 672
avatar of ChaoZhang ChaoZhang
1
집중하다
1617
수행원

다인자 정량 거래 전략, 이 전략은 균등 인자 및 진동 지표 인자를 종합적으로 고려하여 위험을 제어하여 안정성을 향상시킵니다. 이 문서에서는 이 거래 전략의 원리와 장점 및 잠재적 인 위험을 자세히 설명합니다.

전략 원칙

이 전략은 크게 세 가지 모듈로 구성되어 있습니다.

  1. 평행 인자

5개의 다른 주기의 EMA 평균선 ((8, 13, 21, 34, 55일) 을 사용하여 트렌드 필터를 구축한다. 평균선은 짧은에서 긴으로 배열되어 있으며, 단기 평균선 위에 긴 주기 평균선을 통과할 때만 트렌드 특성을 지니고 거래 신호를 생성한다.

  1. 진동 지표 요인

동시에 RSI와 Stochastic의 두 개의 큰 진동 지표와 결합하여 돌파구를 검증하고, 흔들리는 시장에서 많은 가짜 돌파구를 피한다.

RSI의 파라미터는 14이며, RSI가 40-70의 범위에서 다중 조건에 부합할 때, 30-60의 범위에서 하위 조건에 부합한다.

스토카스틱 변수는 ((14,3,3) 이며, K선은 20~80의 범위에서 더 많은 조건에 해당하며, 5~95의 범위에서 더 적은 조건에 해당한다.

  1. 출전 및 출전 논리

평균선 인자와 진동 지표 인자가 동시에 조건이 되면만 입구 신호를 유발한다. 어느 한 인자가 더 이상 조건이 되면, 출구 신호를 발생시킨다.

전체 전략은 엄격한 다중 요소 필터링 메커니즘을 적용하여 높은 승률을 유지하면서도 거래 신호의 안정성과 신뢰성을 보장합니다.

전략적 이점

  • 다중 요소 디자인은 시장 소음을 효과적으로 필터링하여 과도한 거래를 방지합니다.
  • 동시 트렌드 요소와 반전 요소를 고려하고, 동시 트렌드 추적과 점 거래의 장점을 고려합니다.
  • 평행선과 진동 지표가 결합되어 트렌드에 반전 지점을 잡을 수 있습니다.
  • 최적화 공간이 넓고, 변수를 조정하여 더 나은 전략 효과를 얻을 수 있습니다.

위험 경고

  • 다인자 전략 신호 빈도가 낮아 거래 기회를 놓칠 수 있다.
  • 평균선이 지연되는 경우, 더 짧은 주기 지표와 함께 검증해야 합니다.
  • 진동 지표는 거짓 신호를 발생하기 쉽다. 보조적인 요소로만 사용해야 한다.
  • 변화하는 시장 환경에 맞춰 매개 변수를 정기적으로 최적화해야 합니다.

요약하다

이 전략은 트렌드 추적과 반전 거래의 장점을 성공적으로 결합하고, 다인자 모델은 위험을 효과적으로 제어하고, 안정적인 초과 수익을 얻을 수 있다. 이것은 매우 실용적인 정량화 거래 전략 모델이며, 인공지능 커뮤니티가 심층적으로 연구하고 적용할 가치가 있다.

전략 소스 코드
/*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")