この戦略は,主に市場における過買い・過売条件を決定するために,相対強度指数 (RSI) を利用し,トレンドフィルターとして200日間のシンプルムービング・平均値 (SMA) 以上の価格を組み合わせ,取引を決定する.この戦略は3つのRSI指標を通じてエントリー条件を構築する.短期RSIが35を下回り,3期連続で下落傾向を示すとき,第三期RSIが60を下回り,現在の閉値が200日間のSMAを超えると,ロングになる.出口条件は,RSIが50を超えるとである.
この戦略は,トレンドフィルターとして長期移動平均値以上の価格と組み合わせて,トリプルRSIを通じてエントリー条件を構築し,過売り逆転セットアップをキャプチャします.戦略論理はシンプルで明確で,実装し最適化することは簡単です.しかし,この戦略には,シグナル遅延,低取引頻度,一方的な市場動きのみをキャプチャできるリスクや欠点もあります.実際の適用で継続的なデバッグと改善が必要です.ストップ損失と利益取得,ポジション管理,他の指標やその他の方法と組み合わせることで,戦略の安定性と収益性がさらに向上することができます.
/*backtest start: 2023-05-15 00:00:00 end: 2024-05-14 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 //@author Honestcowboy // strategy("Triple RSI [Honestcowboy]" ) // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> // ---------> User Inputs <----------- >> // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> rsiLengthInput = input.int(5, minval=1, title="RSI Length", group="RSI Settings") rsiSourceInput = input.source(close, "Source", group="RSI Settings") // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> // ---------> VARIABLE CALCULATIONS <----------- >> // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> up = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput) down = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput) rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down)) // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> // ---------> CONDITIONALS <----------- >> // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> rule1 = rsi<35 rule2 = rsi<rsi[1] and rsi[1]<rsi[2] and rsi[2]<rsi[3] rule3 = rsi[3]<60 rule4 = close>ta.sma(close, 200) longCondition = rule1 and rule2 and rule3 and rule4 closeCondition = rsi>50 // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> // ---------> GRAPHICAL DISPLAY <----------- >> // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> hline(30, title="Long Condition Line") hline(50, title="Exit Condition Line") plot(rsi) plotshape(longCondition ? rsi-3 : na, title="Long Condition", style=shape.triangleup, color=color.lime, location=location.absolute) plotshape(closeCondition and rsi[1]<50? rsi+3 : na, title="Exit Condition", style=shape.triangledown, color=#e60000, location=location.absolute) // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> // ---------> AUTOMATION AND BACKTESTING <----------- >> // $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ >> if longCondition and strategy.position_size==0 strategy.entry("LONG", strategy.long) if closeCondition strategy.close("LONG")