
이 전략은 먼저 123 형태를 사용하여 역전 신호를 판단하고, 클링거 양적 진동기를 필터로 결합하여 역전 기회를 효율적으로 포착하는 양적 이중 이득 전략을 구현한다.
전략은 두 부분으로 구성됩니다.
123 형태 판단 역전 신호 부분: 2일 연속 하락한 후 3일째 종식, 스토치 지수가 낮은 경우 for 상점; 2일 연속 상승한 후 3일째 종식, 스토치 지수가 높은 경우 for 공점.
클링거 양자 진동기 부분: 클링거 양자 진동기는 가격 변동 범위와 거래량 변화를 결합하여 자금 유입과 유출을 판단한다. 양자 진동기 상에서 평균값을 통과할 때 다목 신호이며, 평균값을 통과할 때 공백 신호이다.
마지막으로, 전략은 위의 두 부분의 신호를 종합하고, 두 번의 승리가 최종 진출을 결정한다.
이 전략의 가장 큰 장점은 역전 형태와 양에너지 지표가 결합되어 역전 기회를 효율적으로 포착할 수 있다는 것입니다. 또한 스토치 지표를 사용하여 가짜 돌파구를 피하고, 클링거 양적 진동기가 실제 자금 흐름을 판단하여 진입 시기를 정확하게 보장 할 수 있습니다.
이 전략의 주요 위험은 반전 형태 판단과 파라미터 설정 문제이다. 반전 신호가 일정하게 지연되어 있기 때문에, 파라미터 설정이 합리적으로 되어 최적의 반전 시기를 놓치지 않도록 하는 것이 필요하다. 또한, 반전 형태 자체가 무효가 될 수도 있다.
위험을 줄이기 위해, 역전 신호를 더 민감하고 적시에 만들기 위해 파라미터를 적절하게 최적화 할 수 있습니다. 또한, 역전 회수가 충분히 많고 폭이 충분히 보장되도록, 회수 확장을 피하기 위해 다른 필터링 조건을 추가 할 수 있습니다.
이 전략은 주로 매개 변수를 조정하고 다른 보조 판단을 추가하는 공간을 최적화할 수 있다. 구체적으로, stoch 지표 변수를 적절히 줄여서 123 형태 판단의 민감성을 최적화할 수 있다. 또한 현재 주류 지표와 형태를 결합하여 MACD 금 포크 사다리, 또는 double top / bottom 다중 바닥과 같은 판단을 할 수 있다.
또한, 전략이 시장의 변화에 더 잘 적응할 수 있도록 스톱 및 스톱 조건을 동적으로 조정하는 것도 고려할 수 있습니다. 또한, 기계 학습과 함께 매개 변수를 실시간으로 최적화 할 수 있습니다.
이 전략은 클래식 역전 이론과 양에너지 기술 지표를 통합하여 역전 기회를 효율적으로 포착합니다. 최적화 공간은 크고, 효과를 더욱 향상시킬 잠재력이 있으며, 실무 테스트와 지속적인 최적화를 할 가치가 있습니다.
/*backtest
start: 2023-10-22 00:00:00
end: 2023-11-21 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 23/12/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 Klinger Oscillator (KO) was developed by Stephen J. Klinger. Learning
// from prior research on volume by such well-known technicians as Joseph Granville,
// Larry Williams, and Marc Chaikin, Mr. Klinger set out to develop a volume-based
// indicator to help in both short- and long-term analysis.
// The KO was developed with two seemingly opposite goals in mind: to be sensitive
// enough to signal short-term tops and bottoms, yet accurate enough to reflect the
// long-term flow of money into and out of a security.
// The KO is based on the following tenets:
// Price range (i.e. High - Low) is a measure of movement and volume is the force behind
// the movement. The sum of High + Low + Close defines a trend. Accumulation occurs when
// today's sum is greater than the previous day's. Conversely, distribution occurs when
// today's sum is less than the previous day's. When the sums are equal, the existing trend
// is maintained.
// Volume produces continuous intra-day changes in price reflecting buying and selling pressure.
// The KO quantifies the difference between the number of shares being accumulated and distributed
// each day as "volume force". A strong, rising volume force should accompany an uptrend and then
// gradually contract over time during the latter stages of the uptrend and the early stages of
// the following downtrend. This should be followed by a rising volume force reflecting some
// accumulation before a bottom develops.
//
// 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
KVO(TrigLen,FastX,SlowX) =>
pos = 0.0
xTrend = iff(hlc3 > hlc3[1], volume * 100, -volume * 100)
xFast = ema(xTrend, FastX)
xSlow = ema(xTrend, SlowX)
xKVO = xFast - xSlow
xTrigger = ema(xKVO, TrigLen)
pos := iff(xKVO > xTrigger, 1,
iff(xKVO < xTrigger, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & Klinger Volume Oscillator", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
TrigLen = input(13, minval=1)
FastX = input(34, minval=1)
SlowX = input(55, minval=1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posKVO = KVO(TrigLen,FastX,SlowX)
pos = iff(posReversal123 == 1 and posKVO == 1 , 1,
iff(posReversal123 == -1 and posKVO == -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 )