
この策略は,アレクサンダー・エルダー博士が彼の弾性移動平均理論に基づいて開発し,市場の買買力を測定するために使用されている.この策略は,通常,三画面取引システムと併用され,単独でも使用できます.博士は13日指数移動平均を使用して,市場の価値に対する合意を反映しています.多極力は,買い手による価格の上昇を価値合意より高く動かす能力を反映しています.空気の力は,売り手による価格の上昇を価値合意より低く動かす能力を反映しています.
多頭力の高点減13日指数移動平均を計算する。空頭力の低点減13日指数移動平均を計算する。
この策略は,Dr.Alexander Elderの買賣力理論に基づいています. 多空力の指標を計算することによって市場の傾向と力を判断します. 具体的には,多頭力の指標は,買手の力を反映しており,それは最高価格減算13日EMAから計算されます. 空頭力の指標は,最低価格減算13日EMAから計算される売り手の力を反映しています. 多頭力の力が一定の値まで下がると空売りシグナルが生じ,空頭力の力が一定の値まで上昇すると多頭シグナルが生じます.
コードでは,高低点と13日EMAを使用して多空力の指標を計算します. 触発値を設定し,指標が触発されたときに対応する多空または空白のポジションを開きます. 同時に,ポジションを管理するために止損とストップストップのロジックを設定します.
この戦略の利点は以下の通りです.
この戦略にはいくつかのリスクがあります.
対策として
この戦略は以下の点で最適化できます.
全体として,この戦略の最適化空間はStill大で,パラメータ,シグナル,リスク管理など,複数の側面から始めることができ,戦略をより安定的かつ信頼性のあるものにします.
この戦略は,エルダー博士の買賣力理論に基づいています.多空力指標を計算して市場の傾向と力を判断し,信号判断規則は比較的簡単で明確です.戦略は,買賣力を使用してトレンドを判断し,損失を制御するリスクなどの利点があります.また,パラメータ主観性,信号誤導などのリスクもあります.我々は,パラメータ最適化,信号フィルターを増やす,厳格な損失を停止するなどの方法によって戦略の安定性と利益率をさらに強化することができます.この戦略は積極的な量化トレーダーに適しています.
/*backtest
start: 2023-12-12 00:00:00
end: 2023-12-19 00:00:00
period: 30m
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version = 5
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 06/10/2022
// 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.
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
strategy(title="Elder Ray (Bull Power) TP and SL", shorttitle = "Bull Power", overlay = true)
Profit = input.float(7, title='Take Profit %', minval=0.01)
Stop = input.float(7, title='Stop Loss %', minval=0.01)
Length = input.int(14, minval=1)
Trigger = input.float(-200)
reverse = input.bool(true, title="Trade reverse")
xPrice = close
xMA = ta.ema(xPrice,Length)
var DayHigh = high
DayHigh := dayofmonth != dayofmonth[1]? high: math.max(high, nz(DayHigh[1]))
nRes = DayHigh - xMA
pos = 0
pos := nRes < Trigger ? 1: 0
possig = reverse and pos == 1 ? -1 :
reverse and pos == -1 ? 1 : pos
if (possig == 1) and strategy.position_size == 0
strategy.entry('Long', strategy.long, comment='Market Long')
strategy.exit("ExitLong", 'Long', stop=close - close * Stop / 100 , limit = close + close * Profit / 100 , qty_percent = 100)
if (possig == -1) and strategy.position_size == 0
strategy.entry('Short', strategy.short, comment='Market Long')
strategy.exit("ExitShort", 'Short', stop=close + close * Stop / 100 , limit = close - close * Profit / 100 , qty_percent = 100)
barcolor(strategy.position_size == -1 ? color.red: strategy.position_size == 1 ? color.green : color.blue )