エルダー・レイ・ブル パワー・コンボ・戦略

作者: リン・ハーンチャオチャン,日付: 2023年11月21日 11:36:48
タグ:

img

概要

この戦略は123の逆転戦略とエルダー・レイの牛のパワー戦略を組み合わせて,トレンドフォローと逆転キャプチャの両方の能力を達成する組み合わせの取引信号を生成します.

戦略の論理

逆転部分

チェン・チンの著書"How I Tripped My Money in The Futures Market"の183ページの逆転戦略論理によると,閉店価格が2日連続で前回の閉店価格より高く,9日間のストーカスティックスローラインが50を下回るとロング,閉店価格が2日連続で前回の閉店価格より低く,9日間のストーカスティックスローラインが50を超えるとショート.

牛の力部分

アレクサンダー・エルダー・レイ博士のエルダー・レイ指標によると,13日指数関数移動平均線 (EMA) は市場のコンセンサス値を表す.ブルパワーでは,買い手の価格をコンセンサス値以上に押し上げる能力を測定する.ベアパワーでは,売り手の価格をコンセンサス値以下に押し上げる能力を反映する.ブルパワーでは,13日間のEMAを日々の高値から引くことで計算される.ベアパワーでは,13日間のEMAを日々の低値から引く.

この戦略における牛勢指標の限界値は0で,0以上の値は取引信号を生成します.

組み合わせた信号

最終的な取引信号は,逆転信号とブールパワー信号が同じ方向に並ぶときに生成される.逆転信号とブールパワー信号の両方が長くなると,ロング信号が起動する.逆転信号とブールパワー信号の両方が短くなると,ショート信号が起動する.

利点を分析

これは逆転とトレンドフォロー戦略の両方を用いて取引信号を形成するコンボ戦略で,逆転を捉え,トレンドをフォローする利点があります.

逆転部分はギャップジャンプの後,逆転機会をロックすることができます.牛のパワー部分は,トレンドが存在する場合にのみポジションが開かれることを保証します.組み合わせると,誤ったブレイクを効果的にフィルタリングし,罠にはまりないようにします.

パラメータは,最適なパラメータ組み合わせを見つけるために,異なる製品と時間枠に最適化するために非常に柔軟です.

リスク分析

逆転と強勢の信号が一致する確率は比較的低いため,信号が薄くなる可能性があります.

逆転部分では,横向のレンジ・バインド価格アクションを逆転機会として誤って識別し,早速エントリーを引き起こす可能性があります.牛勢部分では,いくつかの逆転機会を逃す可能性があります.それらを一緒に使用することで,これらのリスクを一定程度軽減できます.さらなる最適化のために,前向きのトレンドフィルターを導入することができます.

オプティマイゼーションの方向性

  1. 最適な設定を見つけるために,より多くのパラメータ組み合わせを試してください.
  2. トレンドフィルターモジュールを追加して,明確なトレンドがないポジションを繰り返し設定しないようにする.
  3. ストップ・ロスの戦略を 1 つの取引損失を制御するために追加することを検討します.

概要

この戦略は,トレンドフォローと逆転トレードの両方の能力を備えており,コンボ戦略を卓越させています.パラメータ最適化により,安定した利益が期待できます.一方,稀な信号や誤判などのリスクには注意が必要です.今後,トレンドフィルター,ストップロストおよびその他のモジュールが導入され,実用的なパフォーマンスをさらに向上させることができます.


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

もっと