다중 지표 복합 반전 거래 전략

저자:차오장, 날짜: 2023-09-13 15:04:40
태그:

이 전략은 다중 지표 복합 반전 거래 전략 (Multi-indicator Combined Reversal Trading Strategy) 이라고 불립니다. 이 전략은 다양한 기술적 지표를 통합하여 단기 가격 반전의 기회를 파악하고 수익을 위한 이전 추세에 대항하여 거래합니다.

첫째, 전략은 123 역전 패턴을 사용하여 단기 트렌드 역전을 결정합니다. 123 패턴은 3 일 연속으로 가격이 크게 격차되고 세 번째 날이 전날의 반대 방향으로 닫을 때입니다. 통계적으로 123 역전 신호로 거래하면 더 높은 승률이 있습니다.

두 번째로, RSI 지표는 반전 신호의 신뢰성을 평가하기 위해 통합됩니다. 50 이하의 RSI는 과반 판매 상태를 나타냅니다. 50 이상은 과반 구매를 나타냅니다. RSI를 사용하면 123 패턴을 기반으로 한 과도한 신뢰할 수없는 신호를 생성하지 않습니다.

세 번째로, CMO 지표의 다기기 크로스오버가 도입됩니다. 다른 기간의 기하급수적 이동 평균을 결합하는 CMO 크로스오버는 모멘텀 반전을 판단합니다. 그 신호는 123 반전의 시기를 추가로 확인합니다.

여러 지표의 결합 적용은 과도한 불확실성 신호를 피함으로써 가격 반전을 포착하는 성공률을 높입니다. RSI와 CMO가 모두 123 패턴을 지원 할 때만 강력한 반전 거래 신호가 나타날 것입니다.

이 전략은 단기 가격 변동을 포착하기 위해 범위, 오스실레이션 시장에 적합합니다. 그러나 너무 많은 지표를 결합하면 갈등이 발생할 수 있습니다. 매개 변수 최적화가 필요합니다. 거래당 최대 손실을 제한하기 위해 스톱 로스를 사용해야합니다.

결론적으로, 다중 지표 결합 리버설 거래 전략은 시장 리버설에 대한 판단 정확성을 향상시키기 위해 다양한 도구를 통합합니다. 그러나 단일 전략은 완벽하지 않습니다. 거래자는 유연한 거래 사고 방식을 유지하면서 현재의 시장 조건에 따라 검증하고 조정해야합니다.


/*backtest
start: 2023-01-01 00:00:00
end: 2023-03-11 00:00:00
period: 4h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 25/02/2020
// 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
// The related CMOaDisparity Index article is copyrighted material from Stocks & Commodities Dec 2009
// My strategy modification.
//
// 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

CMOD(LengthFirst, LengthSecond, LengthThird) =>
    pos = 0.0
    xEMAFirst = ema(close,LengthFirst)
    xEMASecond  = ema(close,LengthSecond)
    xEMAThird  = ema(close,LengthThird)
    xResFirst = 100 * (close - xEMAFirst) / close
    xResSecond = 100 * (close - xEMASecond) / close
    xResThird = 100 * (close - xEMAThird) / close
    pos := iff(xResThird > xResFirst, -1,
             iff(xResThird < xResSecond, 1, nz(pos[1], 0)))     
    pos

strategy(title="Combo Backtest 123 Reversal & CMOaDisparity Index", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthFirst = input(50, minval=1)
LengthSecond = input(25, minval=1)
LengthThird = input(10, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOD = CMOD(LengthFirst, LengthSecond, LengthThird)
pos = iff(posReversal123 == 1 and posCMOD == 1 , 1,
	   iff(posReversal123 == -1 and posCMOD == -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 )

더 많은