이중 역량 역전 전략은 역전 전략과 역량 전략의 장점을 결합하여 두 종류의 지표의 신호를 사용하여 조합하여 돌파구에서 역전을 수행하여 이익을 얻습니다.
이 전략은 두 부분으로 구성되어 있습니다.
첫 번째 부분은 123 역전 전략입니다.
2일 연속으로 종전 가격이 전날 종전 가격보다 높고, 9일 평균 느린 K선 50보다 낮을 때, 더 많이 한다.
2일 연속으로 종결 가격이 전날의 종결 가격보다 낮고, 9일 평균 빠른 K선 50보다 높을 때, 공백한다.
두 번째 부분은 탄소 변동량 지표이다. 이 지표의 계산 단계는 다음과 같다:
가격변동값 xMom = close - close을 계산합니다.[1]
가격변동의 절대값 xMomAbs = abs (close - close) 을 계산[1])
가격변동값을 필터링하고, 미미값 필터보다 작으면 0으로 표시합니다.
가격변동의 절대값을 필터링하고, 미미값 필터보다 작으면 0으로 기록합니다.
마지막 n 일 동안의 파동 후의 가격 변화값의 nSum을 계산합니다.
마지막 n 일 동안의 파동 후의 가격 변화의 절대값의 nAbsSum을 계산합니다.
동력값을 계산: nRes = 100 * nSum / nAbsSum
동력 값과 경계 TopBand 및 LowBand의 관계를 판단하고 거래 신호를 출력합니다.
이 지표의 특징은 작은 변동을 필터링하여 큰 추세에서만 동력을 추출하는 것입니다.
마지막으로, 두 종류의 지표 신호가 일치할 때 거래 신호가 생성되며, 더 많은 것을 하거나 더 적은 것을 한다.
이 전략은 두 가지 다른 유형의 지표의 장점을 결합하여 신호의 질을 향상시킬 수 있습니다.
123 역전 전략은 변수점의 역전 추세를 포착하여 함정을 피할 수 있다.
변동량 지표는 큰 변동에만 집중하고, 소음을 필터링하여 주요 트렌드를 잡을 수 있다.
이 두가지의 조합은 신호를 검증할 수 있고, 잘못된 거래의 확률을 줄이고, 승률을 높일 수 있다.
이 전략에는 다음과 같은 위험들이 있습니다.
단일 시간 주기 분석으로 더 큰 차원의 추세를 놓칠 수 있습니다.
매개 변수 설정이 너무 딱딱해서 시장의 변화에 적응할 수 없습니다.
이중 인증은 수익을 줄일 수 있는 기회를 놓칠 수 있습니다.
품질이 좋지 않은 거래 신호도 검증되어 손실을 초래합니다.
이 전략은 다음과 같은 부분에서 최적화될 수 있습니다.
더 많은 시간 주기의 검증을 추가하고, 속임수를 피하십시오.
시장에 따라 지표 변수를 조정하는 적응 변수를 설정합니다.
필터값을 최적화하여 신호의 잘못된 보고율을 줄여줍니다.
단편적 손실을 통제하기 위한 손실을 막는 전략을 강화한다.
포지션 관리를 조정하고 자금 사용 효율을 최적화하십시오.
종합적으로, 이진량 역전 전략은 역전 전략과 변동량 지표의 장점을 결합하여 신호 품질과 수익 효율성을 어느 정도 향상시킬 수 있습니다. 그러나 이 전략에는 더 큰 수준의 추세를 무시하는, 파라미터 스틱, 신호 잘못된 알림 등의 위험이 있습니다. 다중 시간 프레임 검증, 자율 적응 파라미터, 스톱 스포드 등의 방법을 통해 이 전략에 최적화를 할 수 있으며, 위험을 줄이고, 안정적인 수익성을 향상시킬 수 있습니다.
/*backtest
start: 2023-09-08 00:00:00
end: 2023-10-08 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 25/09/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 plots a CMO which ignores price changes which are less
// than a threshold value. CMO was developed by Tushar Chande. A scientist,
// an inventor, and a respected trading system developer, Mr. Chande developed
// the CMO to capture what he calls "pure momentum". For more definitive
// information on the CMO and other indicators we recommend the book The New
// Technical Trader by Tushar Chande and Stanley Kroll.
// The CMO is closely related to, yet unique from, other momentum oriented
// indicators such as Relative Strength Index, Stochastic, Rate-of-Change, etc.
// It is most closely related to Welles Wilder`s RSI, yet it differs in several ways:
// - It uses data for both up days and down days in the numerator, thereby directly
// measuring momentum;
// - The calculations are applied on unsmoothed data. Therefore, short-term extreme
// movements in price are not hidden. Once calculated, smoothing can be applied to the
// CMO, if desired;
// - The scale is bounded between +100 and -100, thereby allowing you to clearly see
// changes in net momentum using the 0 level. The bounded scale also allows you to
// conveniently compare values across different securities.
//
// 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
fFilter(xSeriesSum, xSeriesV, Filter) =>
iff(xSeriesV > Filter, xSeriesSum, 0)
CMOfilt(Length,Filter, TopBand, LowBand) =>
pos = 0
xMom = close - close[1]
xMomAbs = abs(close - close[1])
xMomFilter = fFilter(xMom, xMomAbs, Filter)
xMomAbsFilter = fFilter(xMomAbs,xMomAbs, Filter)
nSum = sum(xMomFilter, Length)
nAbsSum = sum(xMomAbsFilter, Length)
nRes = 100 * nSum / nAbsSum
pos := iff(nRes > TopBand, 1,
iff(nRes < LowBand, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Backtest 123 Reversal & CMOfilt", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthCMO = input(9, minval=1)
Filter = input(3, minval=1)
TopBand = input(70, minval=1)
LowBand = input(-70, maxval=-1)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posCMOfilt = CMOfilt(LengthCMO,Filter, TopBand, LowBand)
pos = iff(posReversal123 == 1 and posCMOfilt == 1 , 1,
iff(posReversal123 == -1 and posCMOfilt == -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 )