
Chiến lược này là một hệ thống giao dịch thích ứng dựa trên Stochastic RSI (Chỉ báo RSI ngẫu nhiên), đưa ra quyết định giao dịch bằng cách theo dõi các tín hiệu giao nhau của đường K và đường D tại các vùng quá mua và quá bán. Chiến lược này tích hợp những ưu điểm của RSI truyền thống và các chỉ báo ngẫu nhiên, cung cấp các tín hiệu giao dịch đáng tin cậy hơn thông qua xác nhận kép về động lực giá và tính biến động.
Logic cốt lõi của chiến lược này dựa trên các bước chính sau:
Đề xuất kiểm soát rủi ro:
Chiến lược này kết hợp sức mạnh của các chỉ báo RSI và Stochastic để tạo nên một hệ thống giao dịch đáng tin cậy. Ưu điểm cốt lõi của chiến lược nằm ở độ tin cậy của tín hiệu và khả năng mở rộng của hệ thống. Thông qua các thiết lập tham số hợp lý và cơ chế kiểm soát rủi ro, nó có thể duy trì hiệu suất ổn định trong các môi trường thị trường khác nhau. Người giao dịch nên điều chỉnh các thông số theo đặc điểm cụ thể của thị trường và chú ý kiểm soát rủi ro khi sử dụng trong giao dịch thực tế.
/*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)