
이중 지표 전략 역전 거래 전략은 역전 지표와 트렌드 지표를 결합한 단선 거래 전략이다. 이 전략은 먼저 역전 지표를 사용하여 거래 신호를 생성하고, 그 다음에는 트렌드 지표와 조합하여 더 신뢰할 수있는 거래 신호를 생성한다. 이 전략은 단기 가격 역전을 포착하여 중단계 트렌드 배경에서 거래한다.
이 전략은 두 개의 하위 전략으로 구성되어 있습니다.
첫 번째 하위 전략은 123 역전 전략이다. 이 전략은 가격에 고점 회귀의 형태가 나타나는지 감시한다. 구체적으로, 이 전략은 다음과 같은 상황에서 구매 신호를 발생시킨다: 전날의 종결 가격 하락, 당일 종결 가격 전날의 종결 가격보다 높고, 스토카스틱 슬로 라인이 50보다 낮다. 이 전략은 다음 상황에서는 판매 신호를 발생시킨다: 전날의 종결 가격 상승, 당일 종결 가격 전날 종결 가격보다 낮고, 당일 종결 가격 전날 종결 가격보다 높고, 그리고 스토카스틱 빠른 라인이 50보다 높다.
두 번째 하위 전략은 ergodic 무작위 지표 ((EMDI)) 이다. 그것은 중장선 트렌드의 방향을 식별하는 트렌드형 지표이다. 그것은 이동 평균과 MACD의 생각을 결합하여, 일회성 지수 평평한 이동 평균과 MACD의 빠른 느린 선을 교차하여 구매 및 판매 신호를 생성한다.
이 전략은 두 가지 하위 전략의 신호를 조합한다. 두 가지 하위 전략이 일치하는 신호를 생성할 때만 해당 전략은 포지션을 열는다. 즉, 단기간에 약간의 역전과 함께 강한 중장선 트렌드 지원이 있을 때만 거래한다.
이중 지표 전략 역전 거래 전략은 반전과 트렌드 지표의 조합을 통해 가격 단기 역전 기회를 중간 짧은 선에서 포착하려고 한다. 그것은 잘못된 신호를 효과적으로 필터링하여 거래 위험을 어느 정도 제어할 수 있다. 그러나 이 전략에는 놓친 단기 기회, 파라미터 민감성 및 과다 적응 위험 등과 같은 몇 가지 문제도 있다. 더 많은 지표를 도입하고, 파라미터 설정을 최적화하고, 거래 주파수를 조정하고, 다른 시장에서 테스트함으로써 이 전략의 안정성과 수익성을 더욱 강화할 수 있다.
/*backtest
start: 2023-10-09 00:00:00
end: 2023-10-16 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 28/07/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
// 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.
//
// 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
EMDI(r,s,u,SmthLen) =>
pos = 0
xEMA = ema(close, r)
xEMA_S = close - xEMA
xEMA_U = ema(ema(xEMA_S, s), u)
xSignal = ema(xEMA_U, u)
pos := iff(xEMA_U > xSignal, 1,
iff(xEMA_U < xSignal, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Ergodic MDI", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
r = input(32, minval=1)
s = input(5, minval=1)
u = input(5, minval=1)
SmthLen = input(3, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posEMDI = EMDI(r,s,u,SmthLen)
pos = iff(posReversal123 == 1 and posEMDI == 1 , 1,
iff(posReversal123 == -1 and posEMDI == -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 )