
Chiến lược này là một hệ thống giao dịch kết hợp các tín hiệu mua bán vượt quá RSI với biên giới của vùng Brin để quản lý rủi ro giao dịch bằng cách thiết lập mức dừng động và mức dừng dựa trên tỷ lệ lợi nhuận rủi ro. Cốt lõi của chiến lược là tạo ra tín hiệu giao dịch khi các chỉ số RSI và mức mua bán vượt quá RSI xảy ra và kết hợp với vị trí của giá trong vùng Brin để tăng độ chính xác của giao dịch.
Chiến lược này dựa trên một số nguyên tắc cốt lõi:
Chiến lược này xây dựng một hệ thống giao dịch hoàn chỉnh bằng cách kết hợp các tín hiệu mua bán quá mức RSI và vị trí biên giới của Bollinger Bands. Điểm mạnh cốt lõi của chiến lược là quản lý rủi ro động và thiết lập tỷ lệ lợi nhuận rõ ràng đối với rủi ro, nhưng vẫn cần chú ý đến rủi ro do phá vỡ giả và thay đổi môi trường thị trường.
/*backtest
start: 2024-11-23 00:00:00
end: 2025-02-19 08:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © humblehustle
//@version=5
strategy("RSI Oversold Crossover Strategy", overlay=true)
// === INPUT PARAMETERS ===
rsi_length = input(14, title="RSI Length")
rsi_overbought = input(70, title="RSI Overbought Level")
rsi_oversold = input(30, title="RSI Oversold Level")
// === RSI CALCULATION ===
rsi = ta.rsi(close, rsi_length)
// === ENTRY CONDITIONS ===
long_condition = ta.crossover(rsi, rsi_oversold) // RSI crosses above 30
short_condition = ta.crossunder(rsi, rsi_overbought) // RSI crosses below 70
// === STOP LOSS & TARGET CALCULATION ===
longStop = ta.lowest(low, 10) // Recent swing low for longs
shortStop = ta.highest(high, 10) // Recent swing high for shorts
longTarget = close + (close - longStop) * 2 // 2:1 Risk-Reward
shortTarget = close - (shortStop - close) * 2 // 2:1 Risk-Reward
// === EXECUTE TRADES ===
if long_condition
strategy.entry("Long", strategy.long)
strategy.exit("ExitLong", from_entry="Long", stop=longStop, limit=longTarget)
if short_condition
strategy.entry("Short", strategy.short)
strategy.exit("ExitShort", from_entry="Short", stop=shortStop, limit=shortTarget)
// === ALERTS ===
alertcondition(long_condition, title="Long Signal", message="BUY: RSI Crossed Above 30 (Oversold)")
alertcondition(short_condition, title="Short Signal", message="SELL: RSI Crossed Below 70 (Overbought)")
// === PLOTTING INDICATORS & SIGNALS ===
hline(rsi_overbought, "RSI Overbought", color=color.red)
hline(rsi_oversold, "RSI Oversold", color=color.green)
plot(rsi, title="RSI", color=color.blue, linewidth=2)
plotshape(series=long_condition, location=location.belowbar, color=color.green, style=shape.labelup, title="BUY Signal", size=size.large)
plotshape(series=short_condition, location=location.abovebar, color=color.red, style=shape.labeldown, title="SELL Signal", size=size.large)