
Chiến lược này dựa trên chỉ số RSI và tín hiệu giao nhau của hai đường EMA để xác định điểm mua và bán. Nó tạo ra tín hiệu mua khi giá đóng cửa giảm xuống dưới EMA100 và EMA20 và giá RSI thấp hơn 30; nó tạo ra tín hiệu bán khi giá đóng cửa phá vỡ EMA100 và EMA20 và giá RSI cao hơn 70. Ý tưởng chính của chiến lược này là sử dụng chỉ số RSI để xác định tình trạng mua quá mức, kết hợp với phán đoán xu hướng của đường EMA, để nắm bắt mức thấp và cao của thị trường để thực hiện hoạt động giảm giá.
Chiến lược định lượng tín hiệu chéo RSI và EMA kép là một chiến lược giao dịch định lượng đơn giản và thực tế, có thể nắm bắt tốt hơn các điểm cao và thấp trong tình trạng biến động bằng cách kết hợp chỉ số RSI với đường trung bình EMA, để đặt giá chênh lệch. Tuy nhiên, chiến lược này cũng có một số hạn chế và rủi ro, chẳng hạn như không hiệu quả trong tình trạng xu hướng, thiếu các biện pháp quản lý vị trí và kiểm soát rủi ro. Do đó, trong ứng dụng thực tế, cần phải tối ưu hóa và cải tiến thích hợp theo đặc điểm của thị trường và sở thích cá nhân để tăng cường sự ổn định và khả năng lợi nhuận của chiến lược.
/*backtest
start: 2024-03-01 00:00:00
end: 2024-03-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("RSI-EMA100&20 Buy/Sell Signal", overlay=true)
// Input parameters
rsiLength = input.int(14, "RSI Length")
emaCloseLength = input.int(100, "EMA Length (Closing Price)")
emaLowLength = input.int(20, "EMA Length (Low Price)")
oversoldLevel = input.int(30, "Oversold Level")
overboughtLevel = input.int(70, "Overbought Level")
// Calculate RSI
rsi = ta.rsi(close, rsiLength)
// Calculate EMA of closing price
emaClose = ta.ema(close, emaCloseLength)
// Calculate EMA of low price
emaLow = ta.ema(low, emaLowLength)
// Determine overbought and oversold conditions
isOversold = rsi <= oversoldLevel
isOverbought = rsi >= overboughtLevel
// Plot RSI and its EMAs
plot(rsi, color=color.blue, title="RSI")
plot(emaClose, color=color.green, title="EMA 100 (Closing Price)")
plot(emaLow, color=color.orange, title="EMA 20 (Low Price)")
// Strategy entry condition: Closing price is below both EMAs and RSI is less than or equal to oversold level
buySignal = close < emaClose and close < emaLow and isOversold
// Plot buy signals
plotshape(series=buySignal, style=shape.triangleup, location=location.abovebar, color=color.green, size=size.small)
// Strategy entry
if (buySignal)
strategy.entry("Buy", strategy.long)
// Strategy exit condition: Price crosses above both EMAs and RSI is greater than or equal to overbought level
sellSignal = close > emaClose and close > emaLow and isOverbought
// Plot sell signals
plotshape(series=sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Strategy exit
if (sellSignal)
strategy.entry("Sell", strategy.short)
// Plot sell signals
plotshape(series=sellSignal, style=shape.triangledown, location=location.abovebar, color=color.red, size=size.small)
// Strategy exit
if (sellSignal)
strategy.entry("Sell", strategy.short)