
多空力策略は,Dr.Alexander Elderによって開発され,市場における買入と売却の圧力をElder-ray指標によって測定する.Elder-ray指標は通常,三画面取引システムと一緒に使用されますが,単独でも使用できます.
アレキサンダー・エルダー博士は,13日指数移動平均 ((EMA) を使って,市場価値の合意を表している.多角力は,買い手が価格を価値の合意より高く押し上げる能力を反映している.空気の力は,売り手が価格を平均価値の合意より低く押し上げる能力を反映している.
多頭力は高点から13日EMAを引く.空頭力は低点から13日EMAを引く.
この戦略は,多空力の指標を計算して市場の多空状態を判断する.
多頭力が値より大きいときは多信号,空頭力が値より大きいときは空信号とする.また,逆取引の選択肢がある.
ストップロスを設定し,移動平均周期を最適化し,トレンド指標などと組み合わせて最適化することができる.
多空力策は,Elder-ray指標によって市場の多空状態を判断し,シンプルで直感的で,パラメータを構成できる。しかし,誤信号を生成しやすいため,トレンド判断と止損を加えるためにさらに最適化する必要がある。この策の考え方は学ぶに値するが,直接適用するには慎重である。
/*backtest
start: 2023-09-23 00:00:00
end: 2023-10-23 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version = 2
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 08/12/2016
// 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...
// You can change long to short in the Input Settings
// Please, use it only for learning or paper trading. Do not for real trading.
////////////////////////////////////////////////////////////
strategy(title="Elder Ray (Bull Power) Strategy Backtest")
Length = input(13, minval=1)
Trigger = input(0)
reverse = input(false, title="Trade reverse")
hline(0, color=purple, linestyle=line)
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)))
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)
barcolor(possig == -1 ? red: possig == 1 ? green : blue )
plot(nRes, color=blue, title="Bull Power", style = histogram)