Multi-Timeframe Momentum Confluence Strategy with Liquidity Detection and ATR-Based Risk Management

EMA MACD ATR MTF 流动性捕获 风险回报比 动量
Created on: 2025-07-21 13:07:11 Modified on: 2025-07-21 13:07:11
Copy: 0 Number of hits: 214
avatar of ianzeng123 ianzeng123
2
Follow
319
Followers

 Multi-Timeframe Momentum Confluence Strategy with Liquidity Detection and ATR-Based Risk Management  Multi-Timeframe Momentum Confluence Strategy with Liquidity Detection and ATR-Based Risk Management

Overview

This strategy is a 1-hour timeframe trading system that combines higher timeframe trend confirmation, liquidity trap identification, MACD indicator alignment, and ATR-based risk management mechanisms. The strategy uses multi-timeframe analysis to confirm the overall market trend while utilizing price structure and liquidity zones to find high-probability entry points. It also includes a time filter that only triggers signals during specific trading hours and sets a clear risk-reward ratio to manage stop-loss and take-profit levels for each trade.

Strategy Principle

The core principle of this strategy is to ensure trade direction aligns with the main trend through multi-timeframe analysis. Specifically:

  1. Higher Timeframe Trend Confirmation: The strategy uses the 4-hour timeframe’s EMA200 and MACD indicators to determine the overall market trend. Long positions are only considered when price is above the 4-hour EMA200 and the MACD line is above its signal line; the opposite applies for shorts.

  2. Local Momentum Confirmation: The 1-hour MACD indicator confirms the momentum direction in the current timeframe, ensuring consistency with the higher timeframe trend.

  3. Liquidity Capture Mechanism: The strategy identifies two types of potential high-probability entry points:

    • Price breakouts above recent highs (for longs) or below recent lows (for shorts)
    • Liquidity grabs where price touches a recent low then rebounds (for longs) or touches a recent high then falls (for shorts)
  4. ATR-Based Risk Management:

    • Stop-loss levels are set as a multiple of ATR, automatically adapting to market volatility
    • Take-profit levels are calculated based on a preset risk-reward ratio
    • The strategy defaults to using 10% of account equity as position size
  5. Time Filtering: The strategy only generates signals within user-defined trading hours, avoiding false signals during inactive periods.

Strategy Advantages

After deep analysis of the strategy code, we can summarize the following significant advantages:

  1. Trend and Momentum Confluence: By confirming through multi-timeframe trend and momentum indicators, the reliability of trading signals is significantly improved. When the 4-hour and 1-hour indicators align in direction, the probability of successful trades increases substantially.

  2. Intelligent Liquidity Detection: The strategy can identify liquidity traps and price structure changes in the market, which are often signs of institutional money activity. For example, when price drops to previous lows to attract sell orders and then quickly reverses, the strategy can capture this reversal opportunity.

  3. Adaptive Risk Management: Using ATR to set stop-loss and take-profit levels allows risk management to automatically adjust according to market volatility, expanding stop-loss ranges when volatility increases and tightening them when volatility decreases.

  4. Time Filter: By trading only during specific time periods, the strategy avoids interference from low liquidity or irregular volatility periods, focusing on the most active market sessions.

  5. Fixed Risk-Reward Ratio: The preset risk-reward ratio ensures that the potential return for each trade is at least twice the risk, which favors positive growth in the equity curve over the long term.

Strategy Risks

Despite its well-designed structure, the strategy still has several risks that need attention:

  1. False Breakout Risk: The market may exhibit false breakouts or reversals, leading the strategy into incorrect trades. A solution is to consider adding confirmation filters, such as volume confirmation or price retests.

  2. Over-reliance on MACD: The strategy uses MACD across multiple timeframes, but as a lagging indicator, MACD may generate delayed signals during volatile markets. Consider combining with more sensitive momentum indicators like RSI or stochastic oscillators.

  3. Limitations of Fixed Risk-Reward Ratio: While a 2:1 risk-reward ratio is a reasonable starting point, it may not always be optimal under different market conditions. In strong trending markets, it might miss larger profits; in ranging markets, it might be difficult to reach targets.

  4. Potential Issues with Time Filtering: Fixed trading hours might miss important opportunities outside trading sessions, or the optimal trading hours might change across different seasons and market environments.

  5. Lack of Volume Analysis: The current strategy does not consider volume factors, which are often important indicators for confirming price breakouts and reversals.

Strategy Optimization Directions

Based on deep analysis of the code, here are several possible optimization directions:

  1. Dynamic Risk-Reward Ratio: Automatically adjust the risk-reward ratio based on market volatility state or trend strength. For example, use higher risk-reward ratios (such as 3:1 or 4:1) in strong trending markets, and more conservative ratios (such as 1.5:1) in ranging markets.

  2. Add Volume Filters: Incorporate volume confirmation in entry conditions, executing trades only when breakouts or liquidity grabs are accompanied by significant volume increases.

  3. Introduce Trend Strength Assessment: Implement trend strength indicators like ADX, entering more aggressively in strong trend environments and more conservatively in weak trend environments.

  4. Dynamic Time Filtering: Based on historical data analysis, automatically adjust optimal trading hours for different market phases or seasons, rather than using fixed time ranges.

  5. Partial Profit-Taking Mechanism: Implement a staged profit-taking strategy, such as moving the stop-loss to breakeven after achieving a 1:1 risk-reward ratio, allowing partial positions to continue running to capture larger movements.

  6. Market State Adaptation: Add market environment recognition mechanisms to automatically adjust strategy parameters or pause trading during high volatility or specific market patterns.

Summary

The Multi-Timeframe Momentum Confluence Strategy with Liquidity Detection and ATR-Based Risk Management is a well-designed quantitative trading strategy that ensures trade direction aligns with the main trend through multi-timeframe analysis, uses liquidity capture and price structure to find high-probability entry points, and employs an ATR-based adaptive risk management system.

The core advantages of the strategy lie in its multi-layer confirmation of trend and momentum, intelligent liquidity detection mechanism, and adaptive risk management system. However, like any trading strategy, it also faces risks such as false breakouts, indicator lag, and limitations of fixed parameters.

By introducing optimizations such as dynamic risk-reward ratios, volume filtering, trend strength assessment, and partial profit-taking mechanisms, this strategy has the potential to further improve its performance and adaptability. For traders seeking to capture high-probability trading opportunities in volatile markets while maintaining reasonable risk control, this is a quantitative trading system worth considering.

Strategy source code
/*backtest
start: 2024-07-21 00:00:00
end: 2025-07-19 08:00:00
period: 2h
basePeriod: 2h
exchanges: [{"eid":"Futures_Binance","currency":"ETH_USDT","balance":2000000}]
*/

// MNQ 1H Trading Bot with Liquidity Grab, MACD, EMA200 and ATR R:R Filter (Version 6)
//@version=5
strategy("MNQ 1H Liquidity + MTF Bot", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=10)

// === INPUTS ===
slATRMult = input.float(1.0, "ATR Multiplier for Stop Loss", minval=0.1)
riskReward = input.float(2.0, "Risk-Reward Ratio", minval=1.0)
timeFilterStart = input.int(0, "Start Hour (UTC)", minval=0, maxval=23)
timeFilterEnd = input.int(23, "End Hour (UTC)", minval=0, maxval=23)

// === HIGHER TIMEFRAME FILTERS (4H) ===
htf = "240"
htfPrice = request.security(syminfo.tickerid, htf, close)
htfEMA200 = request.security(syminfo.tickerid, htf, ta.ema(close, 200))
[macdHTF, signalHTF, _] = request.security(syminfo.tickerid, htf, ta.macd(close, 12, 26, 9))

longHTF = htfPrice > htfEMA200 and macdHTF > signalHTF
shortHTF = htfPrice < htfEMA200 and macdHTF < signalHTF

// === MAIN TIMEFRAME (1H) ===
[macdLine, signalLine, hist] = ta.macd(close, 12, 26, 9)

bullBreakout = close > ta.highest(close[1], 5)
bearRejection = close < ta.lowest(close[1], 5)

// === LIQUIDITY GRAB FILTER ===
liqHigh = high[1] > ta.highest(high[2], 10) and close < high[1]
liqLow = low[1] < ta.lowest(low[2], 10) and close > low[1]

// === TIME FILTER ===
withinTime = (hour >= timeFilterStart and hour <= timeFilterEnd)

// === ENTRY CONDITIONS ===
longCond = withinTime and longHTF and macdLine > signalLine and (bullBreakout or liqLow)
shortCond = withinTime and shortHTF and macdLine < signalLine and (bearRejection or liqHigh)

// === ATR-BASED RISK ===
atr = ta.atr(14)
longSL = close - atr * slATRMult
longTP = close + atr * slATRMult * riskReward
shortSL = close + atr * slATRMult
shortTP = close - atr * slATRMult * riskReward

// === EXECUTION ===
if (longCond and strategy.position_size <= 0)
    strategy.entry("Long", strategy.long)
    strategy.exit("Long TP/SL", from_entry="Long", stop=longSL, limit=longTP)

if (shortCond and strategy.position_size >= 0)
    strategy.entry("Short", strategy.short)
    strategy.exit("Short TP/SL", from_entry="Short", stop=shortSL, limit=shortTP)

// === VISUAL ===
plot(ta.ema(close, 200), color=color.orange, title="EMA 200")