
RSI上昇の暗号トレンド戦略は,より長い時間周期 (例えば4時間以上) に適用される暗号通貨と株式市場のトレンド戦略である.
この戦略は,RSI指標の上昇と下降のトレンドを識別し,ブリン帯と変動率指標を組み合わせて,取引の整合を回避する.テストによると,この戦略は,法定通貨との取引よりも,暗号通貨対暗号通貨の取引でうまく機能している.
この戦略は以下の指標を用いています.
取引の具体的ルールは以下の通りです.
ポジション開設のルール
多頭ポジション開設:RSI値が上昇し,ブリン帯と変動率の指標が整合していないことを示し,多頭 空頭開設:RSI値が下がり,ブリン帯と変動率指標が整合していないことを示し,空白
平仓ルール
逆転信号が来たとき,平仓した.
ストップを拡大し,ブリン帯と変動率のパラメータの組み合わせを調整し,基本的分析と組み合わせる.
この戦略は,以下の点でさらに最適化できます.
損失防止機構を増やし,合理的な損失防止幅を設定し,単一損失を制御する.
ブリン帯と変化率指標のパラメータを最適化し,最適なパラメータの組み合わせを見つけます.
MACD,KDなどの他の補助指標を追加して,複数の指標の組み合わせを実現し,信号の正確性を向上させる.
取引を停止し,不規則な波動を回避するために,断流モデルを開発する.
機械学習の方法を使用して,パラメータの組み合わせと信号重量を自動的に最適化します.
チェーン上のデータを組み合わせて,取引所の流動性,資金流動などのパラメータを重視し,戦略の適応性を向上させる.
RSIの上昇暗号トレンド戦略は,ブリン帯と変化率指標を併用してRSI指標を使用し,より長い時間周期で暗号通貨市場トレンドの捉え方を実現する.この戦略の優点は,トレンドの転換を間に合うように捉え,被套を回避し,より長い線を追跡するのに適した方向性の機会である.しかし,この戦略には,無止損性,パラメータ過度依存などの問題もあります.将来,止損性,パラメータ最適化,複数の指標の組み合わせ,機械学習などの方法によって改善され,戦略をより安定して信頼性のあるものにすることができます.
/*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)