
Chiến lược này là một hệ thống giao dịch tần số cao dựa trên nhiều chỉ số kỹ thuật, sử dụng khung thời gian 5 phút, kết hợp với hệ thống đường thẳng, chỉ số động lực và phân tích khối lượng giao dịch. Chiến lược này thích ứng với sự biến động của thị trường bằng cách điều chỉnh động, sử dụng xác nhận tín hiệu nhiều để tăng độ chính xác và độ tin cậy của giao dịch.
Chiến lược sử dụng hệ thống đường hai trung bình ((9 chu kỳ và 21 chu kỳ EMA) làm công cụ định hướng chính và xác nhận động lực kết hợp với chỉ số RSI. Hệ thống sẽ tìm kiếm nhiều cơ hội khi giá nằm trên đường hai trung bình và RSI nằm trong khoảng 40-65.
Chiến lược này xây dựng một hệ thống giao dịch tương đối hoàn chỉnh thông qua việc sử dụng kết hợp nhiều chỉ số kỹ thuật. Ưu điểm của chiến lược là cơ chế xác nhận tín hiệu đa chiều và phương pháp kiểm soát rủi ro động. Mặc dù có một số rủi ro tiềm ẩn, chiến lược vẫn có giá trị ứng dụng tốt hơn thông qua tối ưu hóa tham số và quản lý rủi ro hợp lý.
/*backtest
start: 2019-12-23 08:00:00
end: 2024-11-27 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=5
strategy("Optimized Nifty MidCap Select Options 5-min Intraday Strategy", overlay=true)
// Parameters
emaShortPeriod = input.int(9, title="Short EMA")
emaLongPeriod = input.int(21, title="Long EMA")
rsiPeriod = input.int(14, title="RSI Period")
rsiOverbought = input.int(65, title="RSI Overbought Level") // More conservative than 70
rsiOversold = input.int(35, title="RSI Oversold Level") // More conservative than 30
atrLength = input.int(14, title="ATR Length")
atrMultiplier = input.float(1.5, title="ATR Multiplier")
volumeMultiplier = input.float(1.2, title="Volume Multiplier") // For confirming high-volume trades
// EMA Calculation
emaShort = ta.ema(close, emaShortPeriod)
emaLong = ta.ema(close, emaLongPeriod)
// RSI Calculation
rsiValue = ta.rsi(close, rsiPeriod)
// ATR Calculation
atrValue = ta.atr(atrLength)
// VWAP Calculation
vwapValue = ta.vwap(close)
// Volume Check
volumeCondition = volume > ta.sma(volume, 20) * volumeMultiplier
// Define long and short conditions
// Long Condition:
// Price above both EMAs, RSI not overbought, price above VWAP, and high volume
longCondition = (close > emaShort) and (close > emaLong) and (rsiValue > 40 and rsiValue < rsiOverbought) and (close > vwapValue) and volumeCondition
// Short Condition:
// Price below both EMAs, RSI not oversold, price below VWAP, and high volume
shortCondition = (close < emaShort) and (close < emaLong) and (rsiValue < 60 and rsiValue > rsiOversold) and (close < vwapValue) and volumeCondition
// Entry logic
if (longCondition)
strategy.entry("Buy Call", strategy.long)
if (shortCondition)
strategy.entry("Buy Put", strategy.short)
// Dynamic Take Profit and Stop Loss based on ATR
takeProfitLevel = strategy.position_avg_price * (1 + atrValue * atrMultiplier / 100)
stopLossLevel = strategy.position_avg_price * (1 - atrValue * atrMultiplier / 100)
// Exit strategy based on ATR levels
strategy.exit("Take Profit/Stop Loss", from_entry="Buy Call", limit=takeProfitLevel, stop=stopLossLevel)
strategy.exit("Take Profit/Stop Loss", from_entry="Buy Put", limit=takeProfitLevel, stop=stopLossLevel)
// Plotting indicators
plot(emaShort, title="9 EMA", color=color.blue)
plot(emaLong, title="21 EMA", color=color.red)
hline(rsiOverbought, "RSI Overbought", color=color.red)
hline(rsiOversold, "RSI Oversold", color=color.green)
plot(vwapValue, title="VWAP", color=color.purple)