엘더 레이 불 파워 컴보 전략

저자:차오장, 날짜: 2023-11-21 11:36:48
태그:

img

전반적인 설명

이 전략은 123 역전 전략과 엘더 레이 황소 힘 전략을 결합하여 결합된 거래 신호를 생성하여 트렌드 추적 및 역전 포착 기능을 모두 달성합니다.

전략 논리

반전 부분

의 책 How I Tripled My Money in The Futures Market의 183 페이지에 있는 역전 전략 논리에 따르면: 닫기 가격이 2일 연속으로 이전 닫기보다 높고 9일 연속 스토카스틱 슬로우 라인이 50보다 낮을 때 장거리; 닫기 가격이 2일 연속으로 이전 닫기보다 낮고 9일 연속 스토카스틱 패스트 라인이 50보다 높을 때 단거리.

황소 힘 부분

알렉산더 엘더의 엘더 레이 지표에 따르면: 13일 기하급수적 이동 평균 (EMA) 은 시장의 합의를 나타냅니다. 황소 힘은 구매자의 합의를 초월한 가격을 유도하는 능력을 측정합니다. 곰 힘은 판매자의 합의를 초월한 가격을 유도하는 능력을 반영합니다. 황소 힘은 13일 EMA를 하루의 최고에서 빼어 계산됩니다. 곰 힘은 13일 EMA를 하루의 최저에서 빼어냅니다.

이 전략의 황소 힘 지표의 문턱은 0으로 설정되어 있습니다. 즉 0 이상의 값은 거래 신호를 생성합니다.

결합 신호

최종 거래 신호는 반전 신호와 황소 파워 신호가 같은 방향으로 정렬되면 생성됩니다. 반전 신호와 황소 파워 신호가 길었을 때 긴 신호가 유발됩니다. 반전 신호와 황소 파워 신호가 모두 짧을 때 짧은 신호가 유발됩니다.

장점 분석

이것은 반전 및 트렌드 추종 전략을 모두 사용하여 거래 신호를 형성하는 콤보 전략이며, 반전 및 트렌드를 추적하는 장점을 가지고 있습니다.

역전 부분은 격차 점프 후 역전 기회를 잠금 할 수 있습니다. 황소 힘 부분은 트렌드가 존재하는 경우에만 포지션이 열리는 것을 보장합니다. 결합하면 가짜 브레이크를 효과적으로 필터하고 함정에 빠지지 않도록합니다.

매개 변수들은 최적화를 위해 다양한 제품과 시간 프레임을 통해 최적의 매개 변수 조합을 찾기 위해 매우 유연합니다.

위험 분석

역전 및 황금 파워 신호 사이의 정렬 가능성은 상대적으로 낮고, 희박한 신호로 이어질 수 있습니다.

역전 부분에서는 변동 기회로 변동 범위에 묶인 가격 행동을 잘못 식별하여 조기 진입을 일으킬 수 있습니다. 황소 힘 부분은 일부 역전 기회를 놓칠 수 있습니다. 그것들을 함께 사용하면 이러한 위험을 어느 정도 완화 할 수 있습니다. 앞으로 나아가는 트렌드 필터를 추가 최적화를 위해 도입 할 수 있습니다.

최적화 방향

  1. 최적의 설정을 찾기 위해 더 많은 매개 변수 조합을 시도하십시오.
  2. 트렌드 필터 모듈을 추가하여 명확한 트렌드가 없는 포지션을 반복적으로 설정하는 것을 피합니다.
  3. 거래당 손실을 제어하기 위해 스톱 로스 전략을 추가하는 것을 고려하십시오.

요약

이 전략은 트렌드 추적 및 역전 거래 기능을 모두 갖추고 있으며, 이는 최고의 콤보 전략으로 간주됩니다. 매개 변수 최적화로 안정적인 수익을 기대할 수 있습니다. 한편, 희박한 신호 및 잘못된 판단과 같은 위험은 주의가 필요합니다. 앞으로, 트렌드 필터, 스톱 로스 및 기타 모듈을 도입하여 실질적인 성과를 더욱 향상시킬 수 있습니다.


/*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 )

더 많은