모멘텀 역전 콤보 전략

저자:차오장, 날짜: 2024-01-12 12:22:47
태그:

img

전반적인 설명

이 전략은 123 리버스 전략과 CMO 이동 평균 전략을 결합하여 결합된 거래 신호를 생성합니다. 123 리버스 전략은 스토카스틱 오시레이터에서 시장 동력에 대한 판단과 결합하여 2 일 연속 폐쇄 가격에서 새로운 최고 또는 최저를 형성하여 거래 신호를 생성합니다. CMO 이동 평균 전략은 CMO 지표를 사용하여 가격 동력을 결정하고 거래 신호를 생성합니다. 두 전략의 신호의 조합은 더 신뢰할 수있는 콤보 신호를 형성 할 수 있습니다.

전략 논리

123 리버스 전략은 다음과 같은 논리에 기초하여 거래 신호를 생성합니다.

  1. 닫기 가격이 2일 연속 상승하고 9일 스토카스틱 오시레이터가 50보다 낮을 때

  2. 닫기 가격이 2일 연속 하락하고 9일 스토카스틱 오시레이터가 50보다 높으면, 쇼트하게 됩니다.

가격들이 단기간에 새로운 최고 또는 최저치를 형성했는지 판단하여 스토카스틱 오시레이터의 동력에 대한 표시와 결합하여 거래 신호가 생성됩니다.

CMO 이동 평균 전략은 다음과 같은 논리에 기초하여 거래 신호를 생성합니다.

  1. CMO 값은 5, 10 및 20 일 동안 계산합니다.

  2. 평균을 생각해 보세요.

  3. 평균 CMO가 70을 넘으면, 장거리죠.

  4. 평균 CMO가 -70 이하로 떨어지면, 단축할 수 있습니다.

다른 시간 프레임의 CMO 값에 대한 종합 작전을 수행함으로써 전략은 가격 동력의 방향을 결정하고 거래 신호를 생성합니다.

콤보 전략은 두 전략의 신호에 대한 AND 동작을 수행합니다. 즉, 두 전략이 동시에 구매 또는 판매 신호를 제공했을 때 실제 거래 신호가 활성화됩니다.

장점

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

  1. 결합된 신호는 더 적은 거짓 신호로 더 신뢰할 수 있습니다.

  2. 123 역전 전략은 단기 교정 후의 추세를 포착합니다.

  3. CMO 이동 평균 전략은 더 큰 시간 프레임에서 추진력을 판단합니다.

  4. 다른 시장 환경에 적응할 수 있습니다.

위험 분석

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

  1. 123 역전 전략은 가격 패턴에 크게 의존하고 때때로 실패할 수 있습니다.

  2. CMO 지표는 시장 변동에 민감하며 잘못된 신호를 생성할 수 있습니다.

  3. 콤보 전략의 신호는 너무 보수적이어서 거래 기회를 놓칠 수 있습니다.

  4. 각기 다른 주기와 시장 환경에 적응하기 위해 적절한 매개 변수 조정이 필요합니다.

대책은 다음과 같습니다.

  1. 역전 전략의 패턴 인식 규칙을 최적화합니다.

  2. CMO 이동 평균 전략에 다른 보조 지표를 추가합니다.

  3. 최근 성과를 동적으로 평가하고 그에 따라 매개 변수를 조정합니다.

최적화 방향

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

  1. 기계 학습 알고리즘을 사용하여 자동으로 콤보 무게를 최적화합니다.

  2. 동적으로 매개 변수를 최적화하기 위해 적응 조정 모듈을 추가합니다.

  3. 스톱 로스 모듈을 추가하여 위험을 효과적으로 제어합니다.

  4. 전략의 안정성을 평가하고 패턴 인식 알고리즘을 개선합니다.

  5. 산업 선택, 기본 요소 및 기타 요소를 포함합니다.

결론

이 전략은 매우 상호 보완적인 두 가지 전략 - 123 역전 및 CMO 이동 평균 - 에서 효과적인 조합 거래 시스템을 형성합니다. 적절한 위험 통제와 함께 안정적인 알파 수익을 창출 할 수 있습니다. 알고리즘과 모델이 계속 업그레이드됨에 따라 이 전략의 수익성과 안정성이 더욱 향상 될 것으로 예상됩니다.


/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 3h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 19/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 average of three different length CMO's. This indicator 
//    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

CMOav(Length1,Length2,Length3, TopBand, LowBand) =>
    pos = 0
    xMom = close - close[1]
    xMomabs = abs(close - close[1])
    nSum1 = sum(xMom, Length1)
    nSumAbs1 = sum(xMomabs, Length1)
    nSum2 = sum(xMom, Length2)
    nSumAbs2 = sum(xMomabs, Length2)
    nSum3 = sum(xMom, Length3)
    nSumAbs3 = sum(xMomabs, Length3)
    nRes = 100 * (nSum1 / nSumAbs1 + nSum2 / nSumAbs2 + nSum3 / nSumAbs3 ) / 3
    pos := iff(nRes > TopBand, 1,
    	     iff(nRes < LowBand, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & CMOav", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
Length1 = input(5, minval=1)
Length2 = input(10, minval=1)
Length3 = input(20, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOav = CMOav(Length1,Length2,Length3, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOav == 1 , 1,
	   iff(posReversal123 == -1 and posCMOav == -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 )

더 많은