この戦略は,トレンドの方向と超買い超売り領域を識別するために,複数の技術指標を統合して取引信号を生成します.
主な指標は以下の通りです.
平均方向指数 ((ADX):トレンドの強さを判断する
RSI (相対的に弱い指標) は,超買いと超売りを判断します.
松密平均 ((SMA):短期的なトレンドを判断する
極速SAR指標:長期短期トレンドを判断する
トレンドを突破した.
具体的には,
ADXは,トレンドは存在し,十分な強さがあると判断しています.
SARは長期・短期的な傾向が一致していると判断した.
RSIは超買いと超売りの区間を特定する
価格がSMA平均線を突破したときに入場
価格が通路を突破するときに入場
複数の指標の相互検証により判断の正確性が向上し,異なる戦略の組み合わせにより,体系的な取引システムが形成される.
複数の指標を組み合わせて信号の質を向上させる
複数の戦略の組み合わせで 体系的な入学
ADXはトレンドを識別し,RSIは超買いと超売りを判断した.
SARはトレンドを掴み,SMAとチャネルが突破
複数のパラメータを設定し,反復テストの最適化が必要です.
組み合わせ条件の発生頻度が低い
衝突信号が表示されても処理が困難です.
この戦略は,様々な指標の優位性を最大限に活用し,安定した取引システムを構築する.しかし,取引頻度が合理的であることを保証するために,最適化パラメータの設定が必要です.全体的に,戦略は,強力なトレンドの識別と高効率の入場を統合しています.
/*backtest
start: 2023-09-12 00:00:00
end: 2023-09-13 00:00:00
period: 45m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
// strategy("Combined Strategy", overlay=true, default_qty_value=100, initial_capital=1000, margin_long=0.1)
adxlen = input(7, title="ADX Smoothing")
dilen = input(7, title="DI Length")
dirmov(len) =>
up = ta.change(high)
down = -ta.change(low)
plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
truerange = ta.rma(ta.tr, len)
plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
[plus, minus]
adx(dilen, adxlen) =>
[plus, minus] = dirmov(dilen)
sum = plus + minus
adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
sig = adx(dilen, adxlen)
// The same on Pine Script™
pine_supertrend(factor, atrPeriod) =>
src = hl2
atr = ta.atr(atrPeriod)
upperBand = src + factor * atr
lowerBand = src - factor * atr
prevLowerBand = nz(lowerBand[1])
prevUpperBand = nz(upperBand[1])
lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
int direction = na
float superTrend = na
prevSuperTrend = superTrend[1]
if na(atr[1]) and ta.rsi(close, 21) < 66 and ta.rsi(close,3) > 80 and ta.rsi(close, 28) > 49 and sig > 20
direction := 1
else if prevSuperTrend == prevUpperBand
direction := close > upperBand ? -1 : 1
else
direction := close < lowerBand ? 1 : -1
superTrend := direction == -1 ? lowerBand : upperBand
[superTrend, direction]
[pineSupertrend, pineDirection] = pine_supertrend(3, 10)
upTrend = pineDirection < 0
downTrend = pineDirection > 0
// Define the 20-period SMA
sma20 = ta.sma(close, 20)
a = ta.rsi(close,14)
OB = input(70)
OS = input(30)
os = a > OB
ob = a < OS
if upTrend and close > pineSupertrend and close > sma20 and os
strategy.entry("Buy", strategy.long)
if ta.crossunder(close, sma20) or ob
strategy.close_all()
//define when to breakout of channel
//("ChannelBreakOutStrategy", overlay=true)
length = input.int(title="Length", minval=1, maxval=1000, defval=5)
upBound = ta.highest(high, length)
downBound = ta.lowest(low, length)
if (not na(close[length]))
strategy.entry("ChBrkLE", strategy.long, stop=upBound + syminfo.mintick, comment="ChBrkLE")
strategy.entry("ChBrkSE", strategy.short, stop=downBound - syminfo.mintick, comment="ChBrkSE")