
Đây là một chiến lược giao dịch trong ngày được thiết kế đặc biệt cho các hợp đồng tương lai nhỏ của Nasdaq 100. Cốt lõi của chiến lược sử dụng hệ thống hai đường cân bằng kết hợp giá trung bình trọng lượng giao dịch ((VWAP) làm xác nhận xu hướng và điều chỉnh động vị trí dừng lỗ thông qua độ dao động thực tế ((ATR)). Chiến lược này nắm bắt xu hướng thị trường thông qua kiểm soát rủi ro nghiêm ngặt và quản lý vị trí động trong khi vẫn giữ an toàn cho quỹ.
Chiến lược này dựa trên các thành phần cốt lõi sau:
Chiến lược này tạo ra một hệ thống theo dõi xu hướng vững chắc thông qua sự kết hợp của hệ thống đồng bộ và VWAP, và bảo vệ an toàn của quỹ thông qua cơ chế kiểm soát rủi ro nhiều cấp. Đặc điểm lớn nhất của chiến lược là khả năng thích ứng và quản lý rủi ro của nó, điều chỉnh các tham số một cách động thông qua ATR, cho phép nó duy trì hiệu suất ổn định trong các môi trường thị trường khác nhau. Chiến lược này đặc biệt phù hợp cho giao dịch tương lai nhỏ Nasdaq 100 trong ngày, nhưng yêu cầu các nhà giao dịch thực hiện nghiêm ngặt các quy tắc kiểm soát rủi ro và điều chỉnh tham số khi thích ứng với sự thay đổi của thị trường.
/*backtest
start: 2024-02-25 00:00:00
end: 2025-02-22 08:00:00
period: 1h
basePeriod: 1h
exchanges: [{"eid":"Binance","currency":"SOL_USDT"}]
*/
//@version=5
strategy("Nasdaq 100 Micro - Optimized Risk Management", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)
// === INPUTS ===
riskPerTrade = input(1500, title="Max Risk Per Trade ($)")
profitTarget = input(3000, title="Target Profit Per Trade ($)")
maxWeeklyLoss = input(7500, title="Max Weekly Loss ($)")
emaShort = input(9, title="Short EMA Period")
emaLong = input(21, title="Long EMA Period")
vwapEnabled = input(true, title="Use VWAP?")
contractSizeMax = input(50, title="Max Micro Contracts per Trade")
atrLength = input(14, title="ATR Length")
// === INDICATORS ===
emaFast = ta.ema(close, emaShort)
emaSlow = ta.ema(close, emaLong)
vwapLine = ta.vwap(close)
atrValue = ta.atr(atrLength)
// === CONDITIONS ===
// Long Entry: EMA Crossover + Above VWAP
longCondition = ta.crossover(emaFast, emaSlow) and (not vwapEnabled or close > vwapLine)
// Short Entry: EMA Crossunder + Below VWAP
shortCondition = ta.crossunder(emaFast, emaSlow) and (not vwapEnabled or close < vwapLine)
// Position Size Calculation (Adjusted for Shorts)
riskPerPoint = 5 // MNQ Micro Futures = $5 per point per contract
stopLossPointsLong = atrValue * 2 // More room for longs
stopLossPointsShort = atrValue * 1.5 // Tighter for shorts
contractsLong = math.min(contractSizeMax, math.floor(riskPerTrade / (stopLossPointsLong * riskPerPoint)))
contractsShort = math.min(math.floor(contractsLong * 0.75), contractSizeMax) // Shorts use 75% of long size
// Stop Loss & Take Profit
longSL = close - stopLossPointsLong
longTP = close + (stopLossPointsLong * 3) // 1:3 Risk-Reward for longs
shortSL = close + stopLossPointsShort
shortTP = close - (stopLossPointsShort * 2) // 1:2 Risk-Reward for shorts
// === BREAK-EVEN STOP MECHANISM ===
longBE = close + (stopLossPointsLong * 1.5) // If price moves 50% to TP, move SL to entry
shortBE = close - (stopLossPointsShort * 1) // More aggressive on shorts
// === TRAILING STOP LOGIC ===
trailStopLong = close - (atrValue * 1.5)
trailStopShort = close + (atrValue * 1)
// === EXECUTION ===
// Check for weekly loss limit
weeklyLoss = strategy.netprofit < -maxWeeklyLoss
if (longCondition and not weeklyLoss)
strategy.entry("Long", strategy.long, contractsLong)
strategy.exit("TakeProfitLong", from_entry="Long", limit=longTP, stop=longSL, trail_points=atrValue * 1.5, trail_offset=atrValue * 0.5)
strategy.exit("BreakEvenLong", from_entry="Long", stop=longBE, when=close >= longBE)
if (shortCondition and not weeklyLoss)
strategy.entry("Short", strategy.short, contractsShort)
strategy.exit("TakeProfitShort", from_entry="Short", limit=shortTP, stop=shortSL, trail_points=atrValue * 1, trail_offset=atrValue * 0.5)
strategy.exit("BreakEvenShort", from_entry="Short", stop=shortBE, when=close <= shortBE)
// === STOP TRADING IF WEEKLY LOSS EXCEEDED ===
if (weeklyLoss)
strategy.close_all()