역동 동력 복합 전략

저자:차오장, 날짜: 2024-01-05 14:06:21
태그:

img

전반적인 설명

역동 동력 복합 전략은 역전 전략과 동력 전략을 결합합니다. 가격 역전 신호와 동력 지표 신호를 모두 활용하여 시장 전환점을 더 정확하게 파악하고 가격이 역전되기 시작하면 적시에 시장에 진출합니다.

전략 논리

이 전략은 두 부분으로 구성됩니다.

  1. 123 역전 전략: 클로즈가 이전 클로즈보다 2일 연속 2일 동안 낮게 클로즈되고, 9일 느린 K 라인이 50보다 낮을 때, 클로즈가 이전 클로즈보다 2일 연속 2일 동안 낮게 클로즈되고, 9일 빠른 K 라인이 50보다 높을 때, 쇼트한다.

  2. DAPD 모멘텀 브레이크아웃 전략: DAPD는 21일 최고와 21일 최저 사이의 평균 차이입니다. DAPD 브레이크아웃을 기반으로 입점 및 출구 지점을 결정합니다.

두 개의 전략이 일치하는 신호를 내면 입문 신호가 생성됩니다. 신호가 충돌할 때 옆 라인을 유지하십시오.

장점

이 전략은 역전 전략과 추진 전략의 장점을 결합하여 전환점을 더 정확하게 포착합니다. 주요 장점:

  1. 이중 필터는 신호의 신뢰성을 높이고 신호가 정렬되면 성공률이 높습니다.

  2. 123 패턴은 윙사의 위험을 감소시킵니다.

  3. DAPD 모멘텀은 트렌딩 제품에 적합합니다.

위험성

  1. 신호 타이밍 불일치 위험 두 가지 전략의 신호가 완벽하게 일치하지 않을 수 있습니다.

  2. 매개 변수 조정 어려움이 있습니다.

  3. 트랜잭션 비용의 두 배의 위험이 있습니다. 두 가지 전략 모두에 수수료가 적용됩니다.

최적화

  1. 두 가지 전략의 신호 정렬을 최적화합니다.

  2. 다른 제품에서 다른 매개 변수 집합의 테스트 효과

  3. 약한 신호를 필터링하기 위해 강한 신호만 받아

결론

역동 동력 복합 전략은 역동 동력 전략의 장점을 결합하여 역동 가격을 적시에 포착합니다. 이중 필터는 성공률을 증가시킵니다. 신호 정렬을 최적화함으로써 추가 성능 향상을 달성 할 수 있습니다. 이 전략은 충분한 자본과 거래 전문 지식을 가진 투자자에게 적합합니다.


/*backtest
start: 2023-12-28 00:00:00
end: 2024-01-04 00:00:00
period: 10m
basePeriod: 1m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 10/12/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 is similar to Bollinger Bands. It based on DAPD - Daily
// Average Price Delta. DAPD is based upon a summation for each of the
// highs (hod) for the 21 days prior to today minus the summation for
// each of the lows (lod) for the last 21 days prior to today. The result
// of this calculation would then be divided by 21.
// It will be buy when high above previos DAPD high and sell if low below previos DAPD low
//
// 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

DAPD(Length) =>
    pos = 0.0
    xHighSMA = sma(high, Length)
    xLowSMA = sma(low, Length)        
    nDAPD = xHighSMA - xLowSMA
    nTop = high + nDAPD
    nBottom = low - nDAPD
    pos :=  iff(high > nTop[1], 1,
    	     iff(low < nBottom[1], -1, nz(pos[1], 0)))    
    pos

strategy(title="Combo Backtest 123 Reversal & DAPD", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthDAPD = input(21, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posDAPD = DAPD(LengthDAPD)
pos = iff(posReversal123 == 1 and posDAPD == 1 , 1,
	   iff(posReversal123 == -1 and posDAPD == -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 )

더 많은