累積的なRSIブレイク戦略

作者: リン・ハーンチャオチャン開催日:2023年10月27日11時20分50秒
タグ:

img

概要

この戦略は,累積RSI指標を使用してトレンドを特定し,累積RSI値が主要な値を突破したとき,購入および売却の決定を下します. 効果的に市場のノイズをフィルタリングし,長期的なトレンド取引機会を把握することができます.

戦略の論理

この戦略は,主に取引決定のための累積RSI指標に基づいています.累積RSI指標は,RSI値の累積です. Cumlenパラメータを設定することによって,過去 Cumlen 日間の RSI 値は累積RSI指標を導き出すために加算されます.この指標は短期市場ノイズをフィルターすることができます.

累積RSIインジケーターがボリンジャーバンド上部レールの上を横切ると,ロングポジションが開かれる.累積RSIがボリンジャーバンド下部レールの下を横切ると,オープンポジションは閉じる.ボリンジャーバンドレールは,長年の歴史的データに基づいて動的に計算される.

さらに,トレンドフィルターオプションが追加されています.価格が100日間の移動平均値を超える場合にのみロングトレードが開かれます.これは上向きトレンドチャネルにあることを意味します.このフィルターは市場の変動中に誤ったトレードを回避します.

利点

  • 効率的にノイズをフィルタリングし,累積RSIを使用して中期から長期間のトレンドを把握する
  • トレンドフィルターで不合理な取引を避ける
  • 決定に際して固定値の代わりに動的基準レベルを使用する
  • 異なる市場に基づく調整のための高度な設定可能なパラメータ
  • 10年以上にわたるバックテストの優れた結果で,購入と保有を大幅に上回る

リスク と 改善

  • 一つの指標のみに基づく決定は,他の指標やフィルターを追加することができます.
  • 固定高レバレッジ比で,引き上げに応じて調整できる
  • ショート取引の機会を見ることができます.
  • 市場によって大きく異なるパラメータの組み合わせを最適化
  • ストップ損失,移動ストップ損失などで出口条件を豊かにします.
  • シネージ効果を得るため,他の戦略と組み合わせることを検討する

概要

累積RSIブレイクアウト戦略はスムーズな論理流通を有し,累積RSIをフィルタリングし,トレンド判断を追加することによって中期から長期間のトレンドを正確に識別する.過去10年間でバックテスト結果は例外的である.パラメータ調節,指標を追加,戦略をより堅牢にするために退出条件を豊かにするなどの分野ではまだ改善の余地がある.この新しいコンセプトはさらなる探索と適用に値する.


/*backtest
start: 2023-09-26 00:00:00
end: 2023-10-26 00:00:00
period: 1h
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/
// @version=5
// Author = TradeAutomation


strategy(title="Cumulative RSI Strategy", shorttitle="CRSI Strategy", process_orders_on_close=true, overlay=true, commission_type=strategy.commission.cash_per_contract, commission_value=.0035, slippage = 1, margin_long = 75, initial_capital = 25000, default_qty_type=strategy.percent_of_equity, default_qty_value=110)


// Cumulative RSI Indicator Calculations //
rlen  = input.int(title="RSI Length", defval=3, minval=1)
cumlen = input(3, "RSI Cumulation Length")
rsi = ta.rsi(close, rlen)
cumRSI = math.sum(rsi, cumlen)
ob = (100*cumlen*input(94, "Oversold Level")*.01)
os = (100*cumlen*input(20, "Overbought Level")*.01)


// Operational Function //
TrendFilterInput = input(false, "Only Trade When Price is Above EMA?")
ema = ta.ema(close, input(100, "EMA Length"))
TrendisLong = (close>ema)
plot(ema)


// Backtest Timeframe Inputs // 
startDate = input.int(title="Start Date", defval=1, minval=1, maxval=31)
startMonth = input.int(title="Start Month", defval=1, minval=1, maxval=12)
startYear = input.int(title="Start Year", defval=2010, minval=1950, maxval=2100)
endDate = input.int(title="End Date", defval=1, minval=1, maxval=31)
endMonth = input.int(title="End Month", defval=1, minval=1, maxval=12)
endYear = input.int(title="End Year", defval=2099, minval=1950, maxval=2100)
InDateRange = (time >= timestamp(syminfo.timezone, startYear, startMonth, startDate, 0, 0)) and (time < timestamp(syminfo.timezone, endYear, endMonth, endDate, 0, 0))


// Buy and Sell Functions //
if (InDateRange and TrendFilterInput==true)
    strategy.entry("Long", strategy.long, when = ta.crossover(cumRSI, os) and TrendisLong, comment="Buy", alert_message="buy")
    strategy.close("Long", when = ta.crossover(cumRSI, ob) , comment="Sell", alert_message="Sell")
if (InDateRange and TrendFilterInput==false)
    strategy.entry("Long", strategy.long, when = ta.crossover(cumRSI, os), comment="Buy", alert_message="buy")
    strategy.close("Long", when = ta.crossover(cumRSI, ob), comment="Sell", alert_message="sell")
if (not InDateRange)
    strategy.close_all()

もっと