
RSIダイナミック反転戦略は,RSI指標とK線実体方向を組み合わせて,超買い超売り現象を識別し,反転取引を行う.この戦略は,通常のRSIと急速RSIを同時に使用し,K線実体フィルターと連携して,反転機会を効果的に識別することができます.
この戦略は主に以下の部分によって実行されます.
通常のRSI,RSI勝率指数,RSIパリシャール指数を計算し,その3つの平均をConnors RSIとして取る.
超短線サイクルを反映した価格変化を用いたRSIの計算.
陽線を多用し,陰線を空っぽにして,偽突破を防止する.
コナーズRSIが20を下回ると,急速RSIが25を下回ると,实体陽線が現れて,多作する。
コナーズRSIが80を超えると,速度のRSIが75を超えると,実体陰線が現れて空空する.
ストップ・ロースの退出
コナーズRSIは長線トレンドの反転点を判断し,急速RSIは短線の反転点を判断し,K線実体は突破効果を保証し,反転の機会を効果的に発見し,超買い超売りの両方にタイミングでポジションを開けて反転操作を行う.
この戦略の利点は以下の通りです.
コナーズRSIは長線回路を反映し,急速RSIは短線回路を反映し,両者を組み合わせると,逆転点をより正確に判断できます.
物理的な突破時にのみ操作することで,偽突破による損失を減らすことができます.
RSIのパラメータ,取引の種類,取引の時間帯は,異なる市場に対応するために自由に調整できます.
RSIとK線は基本的な指標であり,戦略の論理は簡単でわかりやすい.
内部指標のみを使用し,コード量が少なく,実装の難しさが低い.
この戦略には以下の主要なリスクがあります.
逆転信号が発せられた後,価格は元のトレンドを継続し,損失をもたらした.
震動が繰り返されるため,取引が無効になる.
物理的なフィルタリングは,偽の突破を完全に回避することはできません.
RSIのパラメータは正しく設定されず,取引機会が逃れ,または複数の無効取引が発生する可能性があります.
特殊な状況でRSI指標は失敗し,誤った信号を生成する.
この戦略は以下の点で最適化できます.
ストップ・ロスの戦略を最適化して,ストップ・ロスを合理化し,単発損失を減らす.
MACD,KDなどの指標のフィルタリングを追加し,信号をより信頼できるようにする.
トレンド,サポート,レジスタンスなどの判断確率を組み合わせ,低確率取引を避ける.
異なる取引品種,周期に対してパラメータテストを行い,最適なパラメータを見つけます.
取引を停止し,大きな損失を回避する.
RSIダイナミック反転戦略は,コナーズRSIと急速RSIによって長短線反転を判断し,K線実体フィルターと連携して信号の有効性を高める.この戦略は,指標の組み合わせ,パラメータの調整の柔軟性などの利点があり,反転の機会を捉え,オーバーバイのオーバーセール時に取引を迅速に介入することができます.しかし,この戦略には,反転の失敗,偽の突破などのリスクもあります.
/*backtest
start: 2023-10-07 00:00:00
end: 2023-11-06 00:00:00
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//Noro
//2018
//@version=2
strategy(title = "Noro's Connors RSI Strategy v1.0", shorttitle = "CRSI str 1.0", overlay = false, default_qty_type = strategy.percent_of_equity, default_qty_value = 100, pyramiding = 10)
//Settings
needlong = input(true, defval = true, title = "Long")
needshort = input(true, defval = true, title = "Short")
usemar = input(false, defval = false, title = "Use Martingale")
capital = input(100, defval = 100, minval = 1, maxval = 10000, title = "Capital, %")
usecrsi = input(true, defval = true, title = "Use CRSI Strategy")
usefrsi = input(true, defval = true, title = "Use FRSI Strategy")
usemod = input(true, defval = true, title = "CRSI+FRSI Mode")
limit = input(25, defval = 25, minval = 1, maxval = 100, title = "RSI limit")
usebod = input(true, defval = true, title = "Use Body-filter")
usecol = input(true, defval = true, title = "Use Color-filter")
fromyear = input(1900, defval = 1900, minval = 1900, maxval = 2100, title = "From Year")
toyear = input(2100, defval = 2100, minval = 1900, maxval = 2100, title = "To Year")
frommonth = input(01, defval = 01, minval = 01, maxval = 12, title = "From Month")
tomonth = input(12, defval = 12, minval = 01, maxval = 12, title = "To Month")
fromday = input(01, defval = 01, minval = 01, maxval = 31, title = "From day")
today = input(31, defval = 31, minval = 01, maxval = 31, title = "To day")
//CRSI
rsilen = 3
streaklen = 2
lookback = 100
rsi = rsi(close,rsilen)
upday = close > close[1] ? 1 : 0
downday = close < close[1] ? -1 : 0
upstreak = upday!=0 ? upstreak[1] + upday : 0
downstreak = downday!=0 ? downstreak[1] + downday : 0
streak = upstreak + downstreak
streakrsi = rsi(streak,streaklen)
roc = close/close[1] - 1
roccount = 0
for i=1 to lookback-1
roccount := roc[i]<roc ? roccount + 1 : roccount
crsi = (rsi + streakrsi + roccount) / 3
//Oscilator
// rsiplot = plot(crsi, title="RSI", style=line, linewidth=1, color=blue)
// band1 = hline(80, title="Upper Line", linestyle=dashed, linewidth=1, color=red)
// band0 = hline(20, title="Lower Line", linestyle=dashed, linewidth=1, color=green)
// fill(band1, band0, color=purple, transp=90)
//Fast RSI
fastup = rma(max(change(close), 0), 7)
fastdown = rma(-min(change(close), 0), 7)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))
//Body Filter
nbody = abs(close - open)
abody = sma(nbody, 10)
body = nbody > abody / 3 or usebod == false
//Color Filter
bar = close > open ? 1 : close < open ? -1 : 0
gbar = bar == 1 or usecol == false
rbar = bar == -1 or usecol == false
//Signals
up1 = rbar and (strategy.position_size == 0 or close < strategy.position_avg_price) and crsi < limit and body and usecrsi
dn1 = gbar and (strategy.position_size == 0 or close > strategy.position_avg_price) and crsi > 100 - limit and body and usecrsi
up2 = rbar and (strategy.position_size == 0 or close < strategy.position_avg_price) and fastrsi < limit and body and usefrsi
dn2 = gbar and (strategy.position_size == 0 or close > strategy.position_avg_price) and fastrsi > 100 - limit and body and usefrsi
exit = ((strategy.position_size > 0 and bar == 1) or (strategy.position_size < 0 and bar == -1)) and body
//Trading
profit = exit ? ((strategy.position_size > 0 and close > strategy.position_avg_price) or (strategy.position_size < 0 and close < strategy.position_avg_price)) ? 1 : -1 : profit[1]
mult = usemar ? exit ? profit == -1 ? mult[1] * 2 : 1 : mult[1] : 1
lot = strategy.position_size == 0 ? strategy.equity / close * capital / 100 * mult : lot[1]
if ((up1 or up2) and usemod == false) or (up1 and up2 and usemod)
if strategy.position_size < 0
strategy.close_all()
strategy.entry("Long", strategy.long, needlong == false ? 0 : lot)
if ((dn1 or dn2) and usemod == false) or (dn1 and dn2 and usemod)
if strategy.position_size > 0
strategy.close_all()
strategy.entry("Short", strategy.short, needshort == false ? 0 : lot)
if exit
strategy.close_all()