RSI アライジング・クリプト・トレンド戦略

作者: リン・ハーンチャオチャン, 日付: 2023年10月17日 17:08:31
タグ:

img

概要

RSI Rising Crypto Trending Strategyは,暗号通貨と株式市場でより長い時間枠 (4h+) に設計されたトレンド取引戦略です.

RSIは,横向市場での取引を避けるためにボリンジャー帯とROCと組み合わせた上昇と減少傾向を特定するために使用されます.テストから,それはフィアットよりも暗号に対する暗号取引がよりうまく機能しているようです.

戦略の論理

戦略は以下の指標を用います

  • RSI - 上昇/下降傾向を特定する
  • Bollinger Bands - 横向市場を特定する
  • ROC - 傾向の方向性を確認する

特別取引規則は次のとおりです.

入国規則

ロングエントリー:RSI上昇 AND BBとROCの横向市場ではない 短いエントリ:RSIが下がり,BBとROCの横向市場ではない

退去規則

反対信号が起動すると出口

利点分析

  • RSI を使ってトレンドターニングポイントを早期に把握する
  • BBを使用して横向市場に閉じ込められるのを避ける
  • ROCは,より強力な信号の傾向方向性を確認
  • 長期間の取引とトレンドの把握に適しています
  • 仮想通貨・仮想通貨ペアが 金融機関への投資を避けるため

リスク分析

  • ストップ・ロスはないので 損失が大きいリスクが高い
  • BBとROCのパラメータが悪ければ,取引が失敗したり,信号が悪くなる可能性があります.
  • 純粋に技術的なので,主要なブラック・スワンイベントを逃します

ストップロスを増やし BB/ROCパラメータを最適化し 基本分析を組み込む

増進 の 機会

この戦略を改善するいくつかの方法:

  1. リスク管理のためにストップロスを追加し,取引ごとに最大損失を設定します.

  2. BBとROCのパラメータをバックテストで最適化して 最適な設定を見つけます

  3. マックド,KDなどの追加指標を組み込む

  4. 流動性のピークで取引を一時停止する流動性モデルを構築し 罠を避ける

  5. 機械学習を使って パラメータと信号の重さを自動的に最適化します

  6. 取引先の流動性や資金流動などのチェーン上のデータを組み込むことで 適応性が向上します

概要

RSI Rising Crypto Trend Strategyは,RSIプラスBBとROCを使用して,より長い時間枠の暗号トレンドを把握する.利点はトレンド逆転を迅速に捉え,罠を避けることである.弱点はストップ損失がないこととパラメータ依存性である.ストップ損失,最適化,機械学習などの強化により,より堅牢になる.


/*backtest
start: 2023-09-16 00:00:00
end: 2023-10-16 00:00:00
period: 2h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © exlux99

//@version=4
strategy(title = "RSI Rising", overlay = true, initial_capital = 100, default_qty_type= strategy.percent_of_equity, default_qty_value = 100, slippage=0,commission_type=strategy.commission.percent,commission_value=0.03)

/////////////////////
source          = close
bb_length       = 20
bb_mult         = 1.0
basis           = sma(source, bb_length)
dev             = bb_mult * stdev(source, bb_length)
upperx           = basis + dev
lowerx           = basis - dev
bbr             = (source - lowerx)/(upperx - lowerx)
bbr_len         = 21
bbr_std         = stdev(bbr, bbr_len)
bbr_std_thresh  = 0.1
is_sideways     = (bbr > 0.0 and bbr < 1.0) and bbr_std <= bbr_std_thresh


////////////////
fromDay = input(defval = 1, title = "From Day", minval = 1, maxval = 31)
fromMonth = input(defval = 1, title = "From Month", minval = 1, maxval = 12)
fromYear = input(defval = 2010, title = "From Year", minval = 1970)
 //monday and session 
// To Date Inputs
toDay = input(defval = 31, title = "To Day", minval = 1, maxval = 31)
toMonth = input(defval = 12, title = "To Month", minval = 1, maxval = 12)
toYear = input(defval = 2021, title = "To Year", minval = 1970)

startDate = timestamp(fromYear, fromMonth, fromDay, 00, 00)
finishDate = timestamp(toYear, toMonth, toDay, 00, 00)
time_cond = true


sourcex = close
length = 2
pcntChange = 1

roc = 100 * (sourcex - sourcex[length])/sourcex[length]
emaroc = ema(roc, length/2)
isMoving() => emaroc > (pcntChange / 2) or emaroc < (0 - (pcntChange / 2))


periods = input(19)
smooth = input(14, title="RSI Length" )
src = input(low, title="Source" )


rsiClose = rsi(ema(src, periods), smooth)
long=rising(rsiClose,2) and not is_sideways and isMoving()
short=not rising(rsiClose,2) and not is_sideways and isMoving()


if(time_cond)
    strategy.entry('long',1,when=long)
    strategy.entry('short',0,when=short)


もっと