この戦略は,相対的に強い指数 ((RSI) とランダムな指標の組み合わせを使用して,二重戦略を形成し,市場の超買い超売り状態をより正確に判断し,より信頼できる取引信号を得ます.
この戦略では,RSIの長さは14周期で,過買の値は70であり,過売りの値は30である.ランダムな指標のK値は3周期平均線で計算され,D値はK値の3周期平均線である.K線が下から上へとD線を突破すると,超買の信号と判断され,逆に超売りの信号である.
戦略は,RSIとランダムな指標の組み合わせで判断して取引シグナルを発信します.
ランダムな指標が上を横切ったとき (K線は下からD線を横切る),同時にRSI指標が70を超えると,超買い信号として判断され,空白する.
ランダムな指標が下を通るとき (K線は上から下を通るD線),同時にRSI指標が30を下回るときは,超売り信号として判断され,多額の取引を行う.
この二重組合せ戦略は,RSI指標の過買過売の判断の優位性を充分に活用し,ランダムな指標の順位性を組み合わせて偽信号をフィルタリングし,より信頼できる取引信号を生成します.
この二重戦略の最大の利点は,偽信号を効果的に削減し,信号の信頼性を向上させることです.
RSI指標が単独で用いられる場合,偽信号が多く発生する.これは,RSI指標が価格の超買い超売り状態を判断するだけで,トレンドの方向を反映できないからである.したがって,単独でRSI信号が多くあることは,信頼できないからである.
ランダムな指標は,価格トレンドの方向を判断することができる.K線をD線に切ると,価格の上昇傾向が継続する可能性を示し,このときRSI超買の信号の信頼性が高く,偽超買ではなく真の超買として判断することができる.
対照的に,K線を下にD線を突破することは,価格トレンドが逆転する可能性を示し,RSIがオーバーセールシグナルを示したとしても,偽オーバーセールであり,取引は行われません.
したがって,RSIとランダムな指標を組み合わせることで,価格の超買超売状態とトレンドの方向性をよりよく把握し,多くの信頼できないシグナルをフィルターして,より正確な取引タイミングを得ることができます.
この戦略にはいくつかのリスクがあります.
ダブル指標の組み合わせは偽の信号をフィルタリングできますが,本物の信号の一部を逃して取引機会を逃す可能性があります.
RSIとランダムな指標のパラメータ設定は,RSI周期が短すぎ,ランダムな指標K,D値の滑らかさが不適切であるなど,信号の正確さに影響を与える.
指標が信号を発信する際には,価格動向,取引量などの要因と組み合わせて確認する必要があり,偽の突破を避ける必要があります.
市場が急激に波動する時に盲目取引を避けるために,システム上のリスクに注意を払う必要があります.
この戦略は,以下の点で最適化できます.
RSIとランダムな指標のパラメータを最適化し,最適なパラメータの組み合わせを見つけます. パラメータの調節は,反測データによって行うことができます. また,機械学習方法を使用して動的にパラメータを最適化することもできます.
取引量の確認指標を増加させ,例えば取引量の急増が,買い売りシグナルを検証する.
移動平均線などのトレンド確認指標と組み合わせて,波動の市引きずりを受けないようにする.例えば,トレンドが上昇する時にのみ購入シグナルを考慮する.
戦略の安定性を高めるために,ブリン帯,価格形態などのシグナルを組み合わせたより複雑な取引規則を識別するために,機械学習の方法を使用します.
ディープラーニングなどの最先端技術を利用して,よりスマートな多元取引システムを開発し,より大きなサンプル空間で戦略規則を最適化します.
この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")