
Chiến lược này là một hệ thống giao dịch kết hợp hệ thống hai đường trung bình ((EMA 50 và 100 chu kỳ) và chỉ số động lực RSI. Chiến lược xác định xu hướng thị trường và thời gian nhập cảnh bằng cách xác định các khu vực giao thoa đường trung bình và RSI, đồng thời sử dụng dừng động để kiểm soát rủi ro. Chiến lược này chủ yếu áp dụng cho các môi trường thị trường có xu hướng rõ ràng, thu lợi nhuận bằng cách nắm bắt xu hướng liên tục.
Lập luận cốt lõi của chiến lược bao gồm các yếu tố then chốt sau:
Đây là một chiến lược theo dõi xu hướng được xây dựng dựa trên lý thuyết phân tích kỹ thuật cổ điển, cân bằng hiệu quả cơ hội kiếm lợi nhuận và kiểm soát rủi ro thông qua việc sử dụng hệ thống đường thẳng và chỉ số RSI. Ưu điểm chính của chiến lược là rõ ràng về logic, có thể kiểm soát rủi ro, nhưng cũng cần phải tối ưu hóa tham số và cải tiến chiến lược phù hợp theo tình hình thị trường trong ứng dụng thực tế.
/*backtest
start: 2024-02-10 00:00:00
end: 2025-02-09 00:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("IME-Bands with RSI Strategy", overlay=true)
// === INPUTS ===
src = close
emaS_value = input.int(50, minval=1, title="EMA Small - Value") // 50 EMA
emaB_value = input.int(100, minval=1, title="EMA Big - Value") // 100 EMA
rsi_length = input.int(14, title="RSI Length")
rsi_source = input.source(close, title="RSI Source")
rsi_overbought = input.int(70, title="RSI Overbought Level")
rsi_oversold = input.int(30, title="RSI Oversold Level")
// === CALCULATIONS ===
// EMAs
emaS = ta.ema(close, emaS_value)
emaB = ta.ema(close, emaB_value)
// RSI
rsi = ta.rsi(rsi_source, rsi_length)
// IME-Band Cross Conditions
isGreenCrossover = emaS > emaB // Green band
isRedCrossover = emaS < emaB // Red band
// Track Green Cross Confirmation
var bool isGreenConfirmed = false
if (isGreenCrossover and not isGreenCrossover[1]) // First green crossover
isGreenConfirmed := true
if (not isGreenCrossover)
isGreenConfirmed := false
// Entry Condition: RSI above 70 on second green candle
entryCondition = isGreenConfirmed and rsi > rsi_overbought and isGreenCrossover
// Exit Condition: Red band confirmed
exitCondition = isRedCrossover
// === STRATEGY RULES ===
// Stop Loss: Lowest point of crossover
var float stopLoss = na
if (isGreenCrossover and not isGreenCrossover[1])
stopLoss := emaB // Set stop loss to EMA Big (crossover point)
// Entry and Exit Trades
if (entryCondition)
strategy.entry("Buy", strategy.long)
stopLoss := na // Reset stop loss after entry
if (exitCondition)
strategy.close("Buy")
// Stop Loss logic
if (strategy.position_size > 0 and not na(stopLoss))
strategy.exit("Stop Loss", from_entry="Buy", stop=stopLoss)
// Plotting
plot(emaS, color=color.green, title="EMA Small (50)", linewidth=1)
plot(emaB, color=color.red, title="EMA Big (100)", linewidth=1)
hline(rsi_overbought, "RSI Overbought", color=color.new(color.red, 70), linestyle=hline.style_dotted)
plot(rsi, color=color.blue, title="RSI")