모멘텀 역전 콤보 전략

저자:차오장, 날짜: 2023-10-23 15:11:20
태그:

img

전반적인 설명

이 전략은 동력 지표 CMO와 역전 지표 스토카스틱을 결합하여 다양한 시장 환경에서 거래 기회를 발견하기 위한 다중 요인 모델을 구축합니다.

논리 분석

이 전략은 두 가지 하위 전략으로 구성됩니다.

  1. 123 역전 전략

    • 9일 스토카스틱을 사용하여 과반 구매 및 과반 판매 수준을 식별

    • 닫기 가격이 2 일 연속 상승하고 스토카스틱이 50 이하인 경우 장면을 선택합니다.

    • 닫기 가격이 2 일 연속 하락하고 스토카스틱이 50보다 높으면 짧습니다.

  2. CMO 절대 가치 전략

    • CMO의 절대값을 계산

    • 70 이상 CMO는 과잉 구매, 단축을 나타냅니다.

    • 20 이하의 CMO는 과잉 판매를 나타냅니다.

마지막으로, 두 개의 하위 전략이 일치할 때 거래 신호가 생성됩니다.

이 전략은 모멘텀 지표 CMO와 역전 지표 스토카스틱의 강점을 충분히 활용합니다. CMO는 트렌드 식별에 좋으며 스토카스틱은 단기적 역전을 잡는데 유용합니다. 이 조합은 모델이 다른 시장 단계에서 기회를 발견 할 수있게합니다.

이점 분석

이 전략은 다음과 같은 장점을 가지고 있습니다.

  1. 다중 요인 모델은 다른 시장 환경에 적응합니다.

  2. CMO는 강력한 트렌드 탐지 능력을 가지고 있습니다. 스토카스틱은 전환점을 정확하게 찾습니다.

  3. 두 개의 신호가 잘못된 신호를 피하고 수익성을 향상시키기 위해 동의 할 때만 거래하십시오.

  4. 큰 매개 변수 조정 공간은 다른 제품 및 시간 프레임에 대한 최적화를 허용

  5. 장기 및 단기 지표를 결합하면 더 많은 기회가 발견됩니다.

  6. 간단하고 명확한 규칙, 이해하기 쉽고 자동화, 알고 거래에 적합

위험 분석

이 전략은 또한 다음과 같은 위험을 가지고 있습니다.

  1. 하위 전략에서 잘못된 신호의 가능성이 존재, 매개 변수는 최적화 필요

  2. 갑작스러운 변화로 인해 큰 손실이 발생할 수 있습니다.

  3. 높은 거래 빈도, 거래 비용 고려가 필요합니다.

  4. 지표의 지연 특성으로 인해 지연이 발생합니다.

  5. 매개 변수 조정은 다양한 제품에 도전

해결책:

  1. 거짓 신호를 줄이기 위해 하위 전략 매개 변수를 최적화

  2. 거래당 손실을 제한하기 위해 스톱 로스를 사용합니다.

  3. 거래 빈도를 낮추기 위한 입력 규칙 조정

  4. 지연을 최소화하기 위해 틱 데이터를 사용

  5. 자동 매개 변수 조정에 기계 학습을 적용

최적화 방향

이 전략은 다음과 같은 측면에서 개선될 수 있습니다.

  1. 체계적인 다중 요인 모델을 위해 변동성과 부피와 같은 더 많은 요소를 도입

  2. 시장 체제에 적응하는 동적 매개 변수 최적화 메커니즘을 구축

  3. 확률과 기하급수 평형 등을 사용하여 입력 논리를 최적화합니다.

  4. 이중 목표를 달성하기 위해 단기 거래로 장기 포지션을 헤지

  5. 비선형 거래 규칙을 만들기 위해 딥 러닝으로 더 많은 기능을 추출합니다.

  6. 인간 편견을 피하기 위해 매개 변수 없는 모델을 탐구

  7. 지연을 줄이기 위해 고주파 데이터와 뉴스 이벤트를 통합합니다.

결론

이 전략은 트렌딩 및 측면 시장에서의 거래 기회에 대한 다중 요소 모델을 구축하기 위해 모멘텀 지표 CMO와 역전 지표 스토카스틱을 활용합니다. 단일 요소 모델에 비해 다중 요소 접근 방식은 복잡한 시장 환경에 더 잘 적응합니다. 한편, 큰 매개 변수 조정 공간과 간단한 규칙은 최적화 및 자동화를 쉽게하고 알고 거래 개발에 적합합니다. 그러나 위험 관리는 중요합니다. 매개 변수 선택과 모델 최적화에 대한 높은 요구가 필요합니다. 전반적으로 모멘텀 역전 콤보 전략은 참조와 탐구에 가치가있는 체계적인 거래 아이디어를 제공합니다.


/*backtest
start: 2023-09-22 00:00:00
end: 2023-10-22 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 17/09/2019
// This is combo strategies for get a cumulative signal. 
//
// First strategy
// This System was created from the Book "How I Tripled My Money In The 
// Futures Market" by Ulf Jensen, Page 183. This is reverse type of strategies.
// The strategy buys at market, if close price is higher than the previous close 
// during 2 days and the meaning of 9-days Stochastic Slow Oscillator is lower than 50. 
// The strategy sells at market, if close price is lower than the previous close price 
// during 2 days and the meaning of 9-days Stochastic Fast Oscillator is higher than 50.
//
// Second strategy
//    This indicator plots the absolute value of CMO. CMO was developed by Tushar 
//    Chande. A scientist, an inventor, and a respected trading system developer, 
//    Mr. Chande developed the CMO to capture what he calls "pure momentum". For 
//    more definitive information on the CMO and other indicators we recommend the 
//    book The New Technical Trader by Tushar Chande and Stanley Kroll.
//    The CMO is closely related to, yet unique from, other momentum oriented indicators 
//    such as Relative Strength Index, Stochastic, Rate-of-Change, etc. It is most closely 
//    related to Welles Wilder`s RSI, yet it differs in several ways:
//        - It uses data for both up days and down days in the numerator, thereby directly 
//          measuring momentum;
//        - The calculations are applied on unsmoothed data. Therefore, short-term extreme 
//          movements in price are not hidden. Once calculated, smoothing can be applied to 
//          the CMO, if desired;
//        - The scale is bounded between +100 and -100, thereby allowing you to clearly see 
//          changes in net momentum using the 0 level. The bounded scale also allows you to 
//          conveniently compare values across different securities.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
Reversal123(Length, KSmoothing, DLength, Level) =>
    vFast = sma(stoch(close, high, low, Length), KSmoothing) 
    vSlow = sma(vFast, DLength)
    pos = 0.0
    pos := iff(close[2] < close[1] and close > close[1] and vFast < vSlow and vFast > Level, 1,
	         iff(close[2] > close[1] and close < close[1] and vFast > vSlow and vFast < Level, -1, nz(pos[1], 0))) 
	pos

CMOabs(Length, TopBand, LowBand) =>
    pos = 0
    xMom = abs(close - close[1])
    xSMA_mom = sma(xMom, Length)
    xMomLength = close - close[Length]
    nRes = abs(100 * (xMomLength / (xSMA_mom * Length)))
    pos := iff(nRes > TopBand, -1,
    	     iff(nRes < LowBand, 1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & CMOabs", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthCMO = input(9, minval=1)
TopBand = input(70, minval=1)
LowBand = input(20, maxval=0)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOabs = CMOabs(LengthCMO, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOabs == 1 , 1,
	   iff(posReversal123 == -1 and posCMOabs == -1, -1, 0)) 
possig = iff(reverse and pos == 1, -1,
          iff(reverse and pos == -1 , 1, pos))	   
if (possig == 1) 
    strategy.entry("Long", strategy.long)
if (possig == -1)
    strategy.entry("Short", strategy.short)	 
if (possig == 0) 
    strategy.close_all()
barcolor(possig == -1 ? #b50404: possig == 1 ? #079605 : #0536b3 )

더 많은