에르고틱 모멘텀 방향 컨버전스 거래 전략

저자:차오장, 날짜: 2024-02-02 10:51:11
태그:

img

전반적인 설명

이 전략의 이름은 에르고틱 모멘텀 디렉션 컨버전스 트레이딩 전략이다. 이 전략은 윌리엄 블라우의 책?? 모멘텀, 디렉션 앤 디버전스?? 에서 기술된 기술적 지표에 기초하여 설계된 양적 거래 전략이다. 이 전략은 주식 가격 모멘텀 지표를 계산하여 주식 가격 모멘텀 지표, 시장 트렌드 방향을 결정하고 가격과 지표 사이의 차이를 찾아 거래 기회를 발견하여 모멘텀, 방향 및 디버전스 3 가지 주요 측면에 초점을 맞추고 있습니다.

전략 논리

이 전략의 핵심 지표는 Ergotic TSI이며 그 계산 공식은 다음과 같습니다.

Val1 = 100 * EMA(EMA(EMA(price change, r), s), u)   

Val2 = EMA(EMA(EMA(absolute value of price change, r), s), u))  

Ergotic TSI = If Val2 != 0, Val1/Val2, else 0

여기서 r, s, u는 평형 매개 변수입니다. 이 지표는 임팩트 오시일레이터 지표에 속하는 가격 변화의 절대 값에 대한 가격 변화의 비율을 반영합니다. 그 다음 신호 라인으로 Ergotic TSI의 EMA 이동 평균을 계산합니다. TSI가 신호 라인을 넘을 때 길게 이동하고 신호 라인을 넘을 때 짧게 이동합니다.

이점 분석

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

  1. 가격 변화 동향을 파악할 수 있는 강력한 능력
  2. 가격 변동에 대한 좋은 필터링
  3. 비교적 좋은 분차 특성
  4. 유연한 매개 변수 설정

위험 분석

이 전략에는 몇 가지 위험도 있습니다.

  1. 트렌드 반전 지점에서 잘못된 신호가 발생할 수 있습니다.
  2. 부적절한 매개 변수 설정은 거래 기회를 놓칠 수 있거나 잘못된 신호를 증가시킬 수 있습니다.
  3. 매개 변수들은 다른 제품과 거래 환경에 맞게 적절하게 조정되어야 합니다. 위험은 매개 변수를 최적화하고 확인을 위해 다른 지표를 결합하고 스톱 로스를 설정하여 제어 할 수 있습니다.

최적화 방향

이 전략은 다음과 같은 측면에서 최적화 될 수 있습니다.

  1. 오픈, 클로즈, 미드 가격 등과 같은 다른 가격 입력을 테스트합니다.
  2. 최적의 매개 변수 조합을 찾기 위해 r, s, u 매개 변수 값을 조정
  3. 신호를 더 확인하기 위해 다른 표시기 또는 필터를 추가합니다.
  4. 스톱 로스 포인트와 출구 메커니즘을 설정

결론

이 전략은 추진력 변화, 트렌드 판단 및 분산 특징의 고려 사항을 통합합니다. 트렌드 기회를 효과적으로 포착 할 수 있습니다. 매개 변수 최적화, 신호 필터링 및 위험 관리 방법으로 좋은 전략 성능을 달성 할 수 있습니다. 전반적으로 전략은 합리적으로 설계되어 추가 연구와 연습 가치가 있습니다.


/*backtest
start: 2023-01-26 00:00:00
end: 2024-02-01 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version = 2
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 13/12/2016
// r - Length of first EMA smoothing of 1 day momentum        4
// s - Length of second EMA smoothing of 1 day smoothing      8    
// u- Length of third EMA smoothing of 1 day momentum         6  
// Length of EMA signal line                                  3
// Source of Ergotic TSI                                      Close
//
// This is one of the techniques described by William Blau in his book "Momentum,
// Direction and Divergence" (1995). If you like to learn more, we advise you to 
// read this book. His book focuses on three key aspects of trading: momentum, 
// direction and divergence. Blau, who was an electrical engineer before becoming 
// a trader, thoroughly examines the relationship between price and momentum in 
// step-by-step examples. From this grounding, he then looks at the deficiencies 
// in other oscillators and introduces some innovative techniques, including a 
// fresh twist on Stochastics. On directional issues, he analyzes the intricacies 
// of ADX and offers a unique approach to help define trending and non-trending periods. 
//
// You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Ergotic TSI Strategy Backtest")
r = input(4, minval=1)
s = input(8, minval=1)
u = input(6, minval=1)
SmthLen = input(3, minval=1)
reverse = input(false, title="Trade reverse")
hline(0, color=blue, linestyle=line)
xPrice = close
xPrice1 = xPrice - xPrice[1]
xPrice2 = abs(xPrice - xPrice[1])
xSMA_R = ema(ema(ema(xPrice1,r), s),u)
xSMA_aR = ema(ema(ema(xPrice2, r), s),u)
Val1 = 100 * xSMA_R
Val2 = xSMA_aR
xTSI = iff (Val2 != 0, Val1 / Val2, 0)
xEMA_TSI = ema(xTSI, SmthLen)
pos = iff(xTSI > xEMA_TSI, 1,
	   iff(xTSI < xEMA_TSI, -1, nz(pos[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)	   	    
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(xTSI, color=green, title="Ergotic TSI")
plot(xEMA_TSI, color=red, title="SigLin")

더 많은