双重戦略:RSIとストカスティックオシレーターを組み合わせる

作者: リン・ハーンチャオチャン開催日:2023年10月7日 16:19:30
タグ:

概要

この戦略は,相対強度指数 (RSI) とストカスティックオシレーターを組み合わせて,過剰購入と過剰販売の市場状況をより正確に識別するための二重戦略を形成し,より信頼性の高い取引信号を生成します.

機能 する 方法

この戦略におけるRSIには14の期間があり,超買値が70で,超売値が30である.ストコスタスティックオシレーターの%K線は3期SMAを使用し,その%D線は3期SMAの%Kである.%Kが%Dを超えると上昇型クロスオーバーが起こり,%Kが%Dを下回ると下落型クロスオーバーが起こる.

取引シグナルは,次の指標の組み合わせに基づいて生成されます.

  1. ストカスティックで上昇のクロスオーバーが起きて RSIが70を超えると ショートシグナルが生成されます

  2. ストキャスティックで下落のクロスオーバーが起きて RSIが30を下回ると,オーバーセール信号が生成され,ロングになる.

この二重戦略は,RSIの強みを活用して過買い/過売りレベルを特定し,ストカスティックのトレンドフォロー機能を使用して誤った信号をフィルタリングし,より信頼性の高い取引エントリをもたらします.

利点

この二重戦略の最大の利点は 誤った信号の減少と信頼性の向上です

RSIだけでは過剰な誤った信号を生む可能性があります.これは,RSIがトレンド方向を考慮せずに価格過剰拡張レベルのみを反映しているためです.したがって,スタンドアロンRSI信号は信頼性がない傾向があります.

一方,ストカストティックオシレーターはトレンド方向を特定することができます. 上向きクロスオーバーは,上向きの勢いが続く可能性があることを示唆し,過剰購入のRSI信号をより信頼できます.

対照的に,下向きのクロスオーバーは,傾向の逆転が迫っていることを示唆する.この場合,過剰に売れたRSI信号は誤った信号である可能性があります.

したがって,RSIとストカスティックを組み合わせることで,過剰拡張レベルとトレンド方向性を2つともよりよく特定し,信頼性のない信号をフィルタリングし,高い確率のターニングポイントを特定することができます.

リスク

この戦略を使用する際に考慮すべきリスクもあります:

  1. 二重指標アプローチは,有効なシグナルをフィルタリングし,取引機会を逃す可能性があります.

  2. RSI周期やストカスティックスムーズ化のようなパラメータの精細な調整は鍵です そうでなければ信号の精度は損なわれることがあります

  3. 誤ったブレイクを避けるために信号を受け取る際に 価格の勢いとボリュームの確認は依然として必要である.

  4. システムリスクに意識し,市場波動が強いときに盲目取引を避ける.

強化

この戦略は,いくつかの側面からさらに強化できます.

  1. 理想的な組み合わせを見つけるためにバックテストを通じてRSIとストカスティックパラメータを最適化する.機械学習技術は動的パラメータ最適化にも適用できる.

  2. 音量ピークなどの信号確認用の音量指標を組み込む

  3. トレンドが上昇しているときにのみ購入信号を考慮してください.

  4. 機械学習を利用して,ボリンジャー帯,価格パターンなどを含むより洗練された信号組み合わせを明らかにし,一貫性を向上させる.

  5. 深層学習とビッグデータ分析を活用して,より優れたサンプル効率を備えた,よりインテリジェントな多目的取引システムを開発する.

結論

概要すると,RSI-ストカスティック・デュアル戦略は,アンサンブルモデリングを通じてそれぞれの強みを効果的に利用する.スタンドアロンRSIと比較して,優れたフィルタリング能力と信号精度を提供しています.注意事項にはパラメータ最適化とリスク管理が含まれます.この方法論は,新しい効果的な取引戦略を発見するために他の指標を組み合わせることにも拡張することができます.


/*backtest
start: 2022-09-30 00:00:00
end: 2023-10-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//@version=2
//Based on Divergences and Hidden Divergences
//Locates bottom market and reversals

strategy("Vix FIX / StochRSI Strategy", pyramiding=9, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=3, overlay=false)

///////////// Stochastic Slow
Stochlength = input(14, minval=1, title="lookback length of Stochastic")
StochOverBought = input(80, title="Stochastic overbought condition")
StochOverSold = input(20, title="Stochastic oversold condition")
smoothK = input(3, title="smoothing of Stochastic %K ")
smoothD = input(3, title="moving average of Stochastic %K")
k = sma(stoch(close, high, low, Stochlength), smoothK)
d = sma(k, smoothD)

 
///////////// RSI 
RSIlength = input( 14, minval=1 , title="lookback length of RSI")
RSIOverBought = input( 70  , title="RSI overbought condition")
RSIOverSold = input( 30  , title="RSI oversold condition")
RSIprice = close
vrsi = rsi(RSIprice, RSIlength)

///////////// Double strategy: RSI strategy + Stochastic strategy

pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bolinger Band Length")
mult = input(2.0    , minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
lb = input(50  , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
new = input(false, title="-------Text Plots Below Use Original Criteria-------" )
sbc = input(false, title="Show Text Plot if WVF WAS True and IS Now False")
sbcc = input(false, title="Show Text Plot if WVF IS True")
new2 = input(false, title="-------Text Plots Below Use FILTERED Criteria-------" )
sbcFilt = input(true, title="Show Text Plot For Filtered Entry")
sbcAggr = input(true, title="Show Text Plot For AGGRESSIVE Filtered Entry")
ltLB = input(40, minval=25, maxval=99, title="Long-Term Look Back Current Bar Has To Close Below This Value OR Medium Term--Default=40")
mtLB = input(14, minval=10, maxval=20, title="Medium-Term Look Back Current Bar Has To Close Below This Value OR Long Term--Default=14")
str = input(3, minval=1, maxval=9, title="Entry Price Action Strength--Close > X Bars Back---Default=3")
//Alerts Instructions and Options Below...Inputs Tab
new4 = input(false, title="-------------------------Turn On/Off ALERTS Below---------------------" )
new5 = input(false, title="----To Activate Alerts You HAVE To Check The Boxes Below For Any Alert Criteria You Want----")
sa1 = input(false, title="Show Alert WVF = True?")
sa2 = input(false, title="Show Alert WVF Was True Now False?")
sa3 = input(false, title="Show Alert WVF Filtered?")
sa4 = input(false, title="Show Alert WVF AGGRESSIVE Filter?")

//Williams Vix Fix Formula
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = (highest(wvf, lb)) * ph

//Filtered Bar Criteria
upRange = low > low[1] and close > high[1]
upRange_Aggr = close > close[1] and close > open[1]
//Filtered Criteria
filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh))
filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not (wvf < upperBand and wvf < rangeHigh)

//Alerts Criteria
alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh) ? 1 : 0
alert3 = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered ? 1 : 0
alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr ? 1 : 0

//Coloring Criteria of Williams Vix Fix
col = wvf >= upperBand or wvf >= rangeHigh ? lime : gray

isOverBought = (crossover(k,d) and k > StochOverBought) ? 1 : 0
isOverBoughtv2 = k > StochOverBought ? 1 : 0
filteredAlert = alert3 ? 1 : 0
aggressiveAlert = alert4 ? 1 : 0

plot(isOverBought, "Overbought / Crossover", style=line, color=red) 
plot(filteredAlert, "Filtered Alert", style=line, color=fuchsia) 
plot(aggressiveAlert, "Aggressive Alert", style=line, color=orange)

if (filteredAlert or aggressiveAlert)
    strategy.entry("Long", strategy.long)

if (isOverBought)
    strategy.close("Long")

    


もっと