
이 전략은 역전 전략과 브린 강도 전략을 통합하여 포트폴리오 거래 신호를 형성하여 트렌드 추적과 역전 캡처의 이중 기능을 구현합니다.
첸의 “내가 어떻게 선물 시장에서 3배의 수익을 올릴 수 있는가”의 183페이지에 따르면 역전략 논리: 종식 가격이 2일 연속으로 전날의 종식 가격보다 높고, 9일 무작위 지표의 슬로라인이 50보다 낮으면, 더 많이 한다. 종식 가격이 2일 연속으로 전날의 종식 가격보다 낮고, 9일 무작위 지표의 슬로라인이 50보다 높으면, 공백한다.
알렉산더 에르드 (Dr. Alexander Eard) 의 부린띠 강도 지표에 따르면: 13일 지수 이동 평균을 사용하여 시장 가치 공감대를 나타냅니다. 다면 강도 지표는 구매자가 가치 공감대보다 높은 가격을 운전하는 능력을 나타냅니다. 공중 강도 지표는 판매자가 가치 공감대보다 낮은 가격을 운전하는 능력을 나타냅니다. 다면 강도 지표는 13일 지수 이동 평균을 빼고 당일 최고 가격을 계산하고 공중 강도 지표는 13일 지수 이동 평균을 빼고 당일 최저 가격을 계산합니다.
이 전략은 강도 지표의 임계값을 0으로 설정하여 강도 지표>0일 때 거래 신호를 발생시킨다.
반전 전략과 강점 전략의 거래 신호가 일치하면 최종 거래 신호가 생성된다. 더 많은 신호를하는 것은 반전 신호가 더 많이 보는 것과 강점 신호가 더 많이 보는 것을 합성한다. 더 적은 신호는 반전 신호가 더 많이 보는 것과 강점 신호가 더 많이 보는 것을 합성한다.
이것은 복합적인 전략으로, 반동 전략과 트렌드 추적 전략을 동시에 사용하여 거래 신호를 형성하며, 반발을 잡는 것과 트렌드를 추적하는 것의 장점을 갖는다.
반전 부분은 공백점 이후의 반전 기회를 잠금할 수 있다. 강도 부분은 트렌드가 존재할 때만 포지션을 열 수 있도록 보장한다. 둘을 결합하면 가짜 브레이크를 효과적으로 필터링하고, 포장을 피할 수 있다.
변수 최적화는 유연성이 높으며, 다양한 품종과 주기별로 조정하여 최적의 변수 조합을 찾을 수 있다.
역전 전략과 강력 전략이 동시에 과다 또는 적지 않은 확률이 낮으며, 신호 발생 빈도가 높지 않을 수 있으며, 어느 정도의 신호 희석 위험이 있다.
반전 부분은 반전 기회로 디스크의 흔들림 조정을 잘못 판단하여 조기 포지션을 구축할 수 있다. 강도 부분은 반전 기회의 일부를 놓칠 수 있다. 둘을 결합하여 사용하면 이러한 위험을 어느 정도 완화할 수 있다. 후기에는 세 판단 모듈을 도입하여 더 나은 최적화를 고려할 수 있다.
이 전략은 트렌드 추적과 역전 거래의 특징을 포함하고 있으며, 종합형 전략의 우수자라고 할 수 있다. 매개 변수 최적화를 통해 좋은 안정적인 수익을 기대할 수 있다. 또한 신호 희소성과 잘못된 판단의 위험을 예방하는 데 주의를 기울여야 한다. 후기에는 트렌드 판단 및 상쇄 모듈 등의 측면에서 최적화하여 전략의 실전 성능을 더욱 우수하게 할 수 있다.
/*backtest
start: 2023-10-21 00:00:00
end: 2023-11-20 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 15/06/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
// Developed by Dr Alexander Elder, the Elder-ray indicator measures buying
// and selling pressure in the market. The Elder-ray is often used as part
// of the Triple Screen trading system but may also be used on its own.
// Dr Elder uses a 13-day exponential moving average (EMA) to indicate the
// market consensus of value. Bull Power measures the ability of buyers to
// drive prices above the consensus of value. Bear Power reflects the ability
// of sellers to drive prices below the average consensus of value.
// Bull Power is calculated by subtracting the 13-day EMA from the day's High.
// Bear power subtracts the 13-day EMA from the day's Low.
// You can use in the xPrice any series: Open, High, Low, Close, HL2, HLC3, OHLC4 and ect...
//
// 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
BP(Trigger,Length) =>
pos = 0
DayHigh = 0.0
xPrice = close
xMA = ema(xPrice,Length)
DayHigh := iff(dayofmonth != dayofmonth[1], high, max(high, nz(DayHigh[1])))
nRes = DayHigh - xMA
pos := iff(nRes > Trigger, 1,
iff(nRes < Trigger, -1, nz(pos[1], 0)))
pos
strategy(title="Combo Strategy 123 Reversal & Elder Ray (Bull Power)", shorttitle="Combo", overlay = true)
Length = input(14, minval=1)
KSmoothing = input(1, minval=1)
DLength = input(3, minval=1)
Level = input(50, minval=1)
//-------------------------
LengthBP = input(13, minval=1)
Trigger = input(0)
reverse = input(false, title="Trade reverse")
posReversal123 = Reversal123(Length, KSmoothing, DLength, Level)
posBP = BP(Trigger,LengthBP)
pos = iff(posReversal123 == 1 and posBP == 1 , 1,
iff(posReversal123 == -1 and posBP == -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 )