
この戦略は、ストキャスティクス RSI (ストキャスティクス RSI) に基づいた適応型取引システムであり、買われすぎと売られすぎの領域における K ラインと D ラインのクロスオーバー信号を監視して取引の決定を行います。この戦略は、従来の RSI とストキャスティクス指標の利点を統合し、価格の勢いとボラティリティの二重の確認を通じて、より信頼性の高い取引シグナルを提供します。
戦略の中核となるロジックは、次の主要なステップに基づいています。
リスク管理の提案:
この戦略は、RSI とストキャスティクス指標の長所を組み合わせて、信頼性の高い取引システムを作成します。この戦略の核心的な利点は、シグナルの信頼性とシステムのスケーラビリティにあります。合理的なパラメータ設定とリスク管理メカニズムにより、さまざまな市場環境で安定したパフォーマンスを維持できます。トレーダーは、実際の取引で使用する際に、特定の市場特性に応じてパラメータを調整し、リスク管理に注意することをお勧めします。
/*backtest
start: 2024-11-26 00:00:00
end: 2024-12-25 08:00:00
period: 4h
basePeriod: 4h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Stochastic RSI Strategy", overlay=true)
// Ayarlar
k_period = input.int(14, title="K Period")
d_period = input.int(3, title="D Period")
stoch_length = input.int(14, title="Stoch Length")
stoch_smoothK = input.int(3, title="Stoch SmoothK")
stoch_smoothD = input.int(3, title="Stoch SmoothD")
lower_band = input.int(20, title="Lower Band")
upper_band = input.int(80, title="Upper Band")
start_date = input(timestamp("2023-01-01 00:00"), title="Start Date")
end_date = input(timestamp("2024-12-31 23:59"), title="End Date")
use_date_filter = input.bool(true, title="Use Date Filter")
// Stochastic RSI hesaplama
rsi = ta.rsi(close, stoch_length)
stoch_rsi = ta.stoch(rsi, rsi, rsi, k_period)
K = ta.sma(stoch_rsi, stoch_smoothK)
D = ta.sma(K, stoch_smoothD)
// Tarih filtresi
is_in_date_range = true
// Alım-satım koşulları
long_condition = ta.crossover(K, D) and K < lower_band and is_in_date_range
short_condition = ta.crossunder(K, D) and K > upper_band and is_in_date_range
// İşlemleri yürüt
if (long_condition)
strategy.close("Short")
strategy.entry("Long", strategy.long)
if (short_condition)
strategy.close("Long")
strategy.entry("Short", strategy.short)
// Grafikte göstergeleri çiz
plot(K, title="K Line", color=color.blue)
plot(D, title="D Line", color=color.red)
hline(lower_band, "Lower Band", color=color.green)
hline(upper_band, "Upper Band", color=color.red)