이중 확인 역행 트렌드 추적 전략

저자:차오장, 날짜: 2024-01-17 18:03:50
태그:

img

전반적인 설명

이중 확인 역전 트렌드 추적 전략은 123 역전 패턴 전략과 지원/저항 브레이크아웃 전략을 통합하여 가격 역전 신호의 이중 확인을 실현하고 소름 끼치는 거래 신호를 필터링하여 전략의 승률을 향상시킵니다.

중장기 거래에 주로 사용된다. 가격이 반전 신호를 형성할 때, 주요 지원 또는 저항 수준이 동시에 깨지는지 감지합니다. 거래 신호는 두 번 확인 후에만 생성됩니다.

전략 원칙

이중 확인 역전 트렌드 추적 전략은 두 부분으로 구성됩니다.

  1. 123 회전 패턴 전략

    이전 두 개의 촛불의 폐쇄 가격을 비교하여 가격이 반전 패턴을 형성했는지 여부를 결정합니다. 잘못된 기회를 필터링하기 위해 변동을 결정하기 위해 스토카스틱 지표와 결합합니다.

  2. 지원/저항 침투 전략

    전날의 가장 높은 가격, 가장 낮은 가격 및 폐쇄 가격을 사용하여 지원 및 저항 수준을 계산합니다. 가격이 이러한 핵심 수준을 돌파하는지 모니터링하십시오.

가격이 두 전략의 거래 신호를 동시에 충족하면 반전 신호가 두 번 확인된 것으로 간주되며 최종 거래 명령이 생성됩니다.

전략 의 장점

  • 이중 신호 확인으로 더 높은 신뢰성
  • 역전 추적을 통해 전환 기회를 적시에 포착
  • 스토카스틱 지표로 효과적인 가짜 브레이크오프 필터링

전략 의 위험

  • 이중 확정으로 인해 적은 수의 기회가 필터링됩니다.
  • 주요 트렌드에서 역전 실패 위험

매개 변수들은 이중 확인의 엄격성을 조정하고 승률과 수익성있는 거래의 수를 균형을 맞추기 위해 최적화 될 수 있습니다.

최적화 방향

  • 오시슬레이션 필터링을 최적화하기 위해 스토카스틱 매개 변수를 조정
  • 지원/저항 수준을 계산하기 위한 다른 시간 프레임을 테스트
  • 주요 트렌드 하에서 반전 위험을 줄이기 위해 스톱 로스 전략을 추가

결론

이중 확인 역전 트렌드 추적 전략은 역전 패턴과 주요 레벨 브레이크오웃의 장점을 성공적으로 결합합니다. 신호 품질을 향상시키는 동시에 거래 수를 보장합니다. 중장기 트렌드 거래에 적합한 전략입니다. 매개 변수 조정 및 스톱 로스 전략을 추가하면 전략의 안정성과 실행성을 더욱 향상시킬 수 있습니다.


/*backtest
start: 2023-12-17 00:00:00
end: 2024-01-16 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=4
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 15/09/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 name ‘Floor-Trader Pivot,’ came from the fact that Pivot points can 
// be calculated quickly, on the fly using price data from the previous day 
// as an input. Although time-frames of less than a day can be used, Pivots are 
// commonly plotted on the Daily Chart; using price data from the previous day’s 
// trading activity. 
//
// 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


FPP() =>
    pos = 0
    xHigh  = security(syminfo.tickerid,"D", high[1])
    xLow   = security(syminfo.tickerid,"D", low[1])
    xClose = security(syminfo.tickerid,"D", close[1])
    vPP = (xHigh+xLow+xClose) / 3
    vR1 = (vPP * 2) - xLow
    vS1 = (vPP * 2) - xHigh
    pos := iff(close > vR1, 1,
             iff(close < vS1, -1, nz(pos[1], 0))) 
    pos

strategy(title="Combo Backtest 123 Reversal & Floor Pivot Points", shorttitle="Combo", overlay = true)
Length = input(15, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posFPP = FPP()
pos = iff(posReversal123 == 1 and posFPP == 1 , 1,
	   iff(posReversal123 == -1 and posFPP == -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 )

더 많은