急速なスカルピング RSI 切り替え戦略 v1.7

作者: リン・ハーンチャオチャン開催日:2023年12月22日 15時10分40秒
タグ:

img

概要

NoroのFast Scalping RSISwitching戦略は,RSI指標を使用して過買い・過売の機会を特定する定量的な取引戦略である.この戦略には,キャンドルスタイクパターン,移動平均フィルター,ストップロスの方法も含まれ,リスクを制御する.

この戦略の主な要素は以下の通りです.

  1. 急速なRSI指標: 過剰購入と過剰販売レベルを特定する
  2. キャンドルスティック パターン: トレンドの方向性を決定するのに役立ちます
  3. 移動平均フィルター: 誤った信号を避けるために SMA を使用する
  4. ストップ・ロスのメカニズム: RSI 制限に基づいてストップ・ロスを実施する

戦略の論理

NoroのFast Scalping RSI Switching戦略は,主に以下の取引信号を特定しています.

  1. 急速なRSI過剰購入/過剰販売シグナル: 急速なRSIが上限を超えたり下限を超えたときに取引シグナルが生成されます.

  2. キャンドルスティック・シグナル: キャンドルスティック・パラメータは,ボディサイズや方向性などで,トレンドを決定し,急速なRSI信号を補完するために使用されます.

  3. SMAフィルター信号: SMA方向は偽の突破信号をフィルタリングします.

  4. ストップ・ロスのシグナル: 急速なRSIが上限以上または下限を下回るとポジションは閉鎖されます.

この戦略は,特に,高速RSIの過剰購入および過剰販売ゾーンに基づいて取引機会を特定します.高速RSIが下限以下を突破すると過剰販売状態を示し,上限を超えると過剰購入状態を示します.

騒音を避けるため,次の追加条件が追加されます.

  1. キャンドルボディサイズ: 大きいキャンドルボディはより強い傾向を示しています
  2. ろうそくの方向性:上昇傾向または下落傾向を決定する
  3. SMAフィルター: 誤ったブレイクシグナルをフィルターで排除する
  4. ストップ・ロス: 急速なRSIが限界を超えると取引を終了する.

この戦略は,高速RSI,キャンドルスティック,移動平均値,ストップロスを組み合わせて 取引信号を生成します.

利点

この戦略の利点は以下の通りです.

  1. 急速なRSIは敏感です. 過剰購入/過剰販売の機会を迅速に把握します.
  2. キャンドルスティック&MAフィルター: 偽信号を避ける
  3. 自動ストップ損失: リスクを効果的に制御する
  4. スカルピングに適しています.短時間枠でうまく動作します.例えば1時間,30分.
  5. 楽に最適化:パラメータは,異なる市場のために調整することができます

リスク

考慮すべきリスクもいくつかあります.

  1. 連続ストップ損失: 範囲市場ではより多くのストップ損失信号が発生する可能性があります.
  2. パラメータ最適化が必要: パラメータは異なるペアとタイムフレームに調整する必要があります
  3. すべての損失を回避できない: 時間内に損失を停止しても,損失が生じる

次の最適化方法はリスクを軽減するのに役立ちます.

  1. 誤った信号を減らす
  2. ストップ・ロスの配置を最適化する: 単一の取引損失のサイズを制御する
  3. ポジションサイズを追加する:複数の取引にリスクを分散する

オプティマイゼーションの方向性

この戦略をさらに最適化する方法には以下の通りがあります.

  1. 収益目標を達成する際に部分的な利益を得る
  2. リスク管理の強化: リスクの多様化のためにポジションのサイズ化規則を組み込む
  3. パラメータ調整: 時間枠間のパラメータ調整のテスト効果
  4. 機械学習: アルゴリズムを使用して,時間とともにパラメータを自動的に最適化します
  5. 安定性テスト: より多くのシンボルペアで戦略のパフォーマンスを評価する

利潤採取,リスク管理,パラメータ最適化,機械学習,安定性テストを組み込むことで 戦略の安定性が著しく向上できます

結論

要するに,NoroのFast Scalping RSI Switching Strategyは,高速RSI指標と補充的なキャンドルスタック分析を組み合わせて,過剰購入および過剰販売の取引機会を特定する.迅速な信号応答時間,最適化しやすい,ストップロスのモジュールが組み込まれているため,この短期取引戦略は,さらなる機械学習とパラメータチューニング後にポジティブな結果を生む可能性が強い.


/*backtest
start: 2023-12-14 00:00:00
end: 2023-12-18 00:00:00
period: 15m
basePeriod: 5m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

//Noro
//2018

//@version=2
strategy(title = "Noro's Fast RSI Strategy v1.7", shorttitle = "Fast RSI str 1.7", overlay = true)

//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, %")
usersi = input(true, defval = true, title = "Use Fast RSI Strategy")
usemm = input(true, defval = true, title = "Use Min/Max Strategy")
usebc = input(true, defval = true, title = "Use BarColor Strategy")
usesma = input(false, defval = false, title = "Use SMA Filter")
smaperiod = input(20, defval = 20, minval = 2, maxval = 1000, title = "SMA Filter Period")
fast = input(7, defval = 7, minval = 2, maxval = 50, title = "Fast RSI Period")
limit = input(30, defval = 30, minval = 1, maxval = 100, title = "RSI limit")
rsisrc = input(close, defval = close, title = "RSI Price")
rsibars = input(1, defval = 1, minval = 1, maxval = 20, title = "RSI Bars")
mmbars = input(1, defval = 1, minval = 1, maxval = 5, title = "Min/Max Bars")
showsma = input(false, defval = false, title = "Show SMA Filter")
showarr = input(false, defval = false, title = "Show Arrows")
fromyear = input(2018, defval = 2018, 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")

//Fast RSI
fastup = rma(max(change(rsisrc), 0), fast)
fastdown = rma(-min(change(rsisrc), 0), fast)
fastrsi = fastdown == 0 ? 100 : fastup == 0 ? 0 : 100 - (100 / (1 + fastup / fastdown))

//Limits
bar = close > open ? 1 : close < open ? -1 : 0
uplimit = 100 - limit
dnlimit = limit

//RSI Bars
upsignal = fastrsi > uplimit ? 1 : 0
dnsignal = fastrsi < dnlimit ? 1 : 0
uprsi = sma(upsignal, rsibars) == 1
dnrsi = sma(dnsignal, rsibars) == 1

//Body
body = abs(close - open)
abody = sma(body, 10)

//MinMax Bars
min = min(close, open)
max = max(close, open)
minsignal = min < min[1] and bar == -1 and bar[1] == -1 ? 1 : 0
maxsignal = max > max[1] and bar == 1 and bar[1] == 1 ? 1 : 0
mins = sma(minsignal, mmbars) == 1
maxs = sma(maxsignal, mmbars) == 1

//SMA Filter
sma = sma(close, smaperiod)
colorsma = showsma ? blue : na
plot(sma, color = colorsma, linewidth = 3)

//Signals
up1 = bar == -1 and (strategy.position_size == 0 or close < strategy.position_avg_price) and dnrsi and body > abody / 5 and usersi
dn1 = bar == 1 and (strategy.position_size == 0 or close > strategy.position_avg_price) and uprsi and body > abody / 5 and usersi
up2 = mins and (close > sma or usesma == false) and fastrsi < 70 and usemm
dn2 = maxs and (close < sma or usesma == false) and fastrsi > 30 and usemm 
up3 = sma(bar, 2) == -1 and usebc
dn3 = sma(bar, 2) == 1 and usebc
exit = (((strategy.position_size > 0 and fastrsi > dnlimit and bar == 1) or (strategy.position_size < 0 and fastrsi < uplimit and bar == -1)) and body > abody / 2)

//Arrows
col = exit ? black : up1 or dn1 ? blue : up2 or dn2 ? red : na
needup = up1 or up2
needdn = dn1 or dn2
needexitup = exit and strategy.position_size < 0
needexitdn = exit and strategy.position_size > 0
plotarrow(showarr and needup ? 1 : na, colorup = blue, colordown = blue, transp = 0)
plotarrow(showarr and needdn ? -1 : na, colorup = blue, colordown = blue, transp = 0)
plotarrow(showarr and needexitup ? 1 : na, colorup = black, colordown = black, transp = 0)
plotarrow(showarr and needexitdn ? -1 : na, colorup = black, colordown = black, transp = 0)

//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 or up3
    if strategy.position_size < 0
        strategy.close_all()
        
    strategy.entry("Long", strategy.long, needlong == false ? 0 : lot)

if dn1 or dn2 or dn3
    if strategy.position_size > 0
        strategy.close_all()
        
    strategy.entry("Short", strategy.short, needshort == false ? 0 : lot)
    
if time > timestamp(toyear, tomonth, today, 23, 59) or exit
    strategy.close_all()

もっと