这是一个专为纳斯达克100微型期货设计的日内交易策略。策略核心采用双均线系统结合成交量加权平均价格(VWAP)作为趋势确认,并通过真实波动幅度(ATR)动态调整止损位置。该策略在保持资金安全的同时,通过严格的风险控制和动态的仓位管理来捕捉市场趋势。
策略主要基于以下几个核心组件: 1. 信号系统采用9周期与21周期指数移动平均线(EMA)的交叉来识别趋势方向。当短期均线向上穿越长期均线时产生做多信号,反之产生做空信号。 2. 使用VWAP作为趋势确认指标,价格需要位于VWAP之上才能开多仓,位于VWAP之下才能开空仓。 3. 风险管理系统使用基于ATR的动态止损,多仓止损设置为2倍ATR,空仓为1.5倍ATR。 4. 获利目标采用不对称设计,多仓使用3:1的收益风险比,空仓使用2:1的收益风险比。 5. 设置了移动止损和保本止损机制,当价格达到目标利润的50%时,止损点上移至成本位。
该策略通过均线系统和VWAP的配合建立了稳健的趋势跟踪系统,并通过多层次的风险控制机制保护资金安全。策略的最大特点是其适应性和风险管理能力,通过ATR动态调整各项参数,使其能够在不同市场环境下保持稳定性能。该策略特别适合日内交易纳斯达克100微型期货,但需要交易者严格执行风险控制规则,并根据市场变化适时调整参数。
/*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()