NQ LineTrade EA: Automated Key-Level & Trend Following Strategy for MetaTrader 4
Navigating index volatility—especially on high-momentum assets like the Nasdaq (NQ)—requires precision, disciplined risk management, and objective entry triggers.
The NQ LineTrade EA is a custom MetaTrader 4 (MT4) Expert Advisor engineered to automate high-probability key-level rejection trades. By aligning multi-timeframe trends with major weekly and daily support/resistance levels, this EA eliminates emotional decision-making and executes trades exclusively during optimal market sessions.

🛠️ Core Strategy & Trading Logic
The EA operates on a structured 6-step framework designed to catch trend-aligned bounces while filtering out market noise:
-
Multi-Timeframe Key Level Identification
-
Automatically extracts Highs and Lows (HH/LL) from higher timeframes (Weekly, Daily, H4, and H1).
-
Dynamically identifies the nearest major Support or Resistance line relative to current price action.
-
-
Trend Alignment Filter (D1 / H4 / H1)
-
Uses an Exponential Moving Average (EMA) across D1, H4, and H1 timeframes.
-
Buy Trades: Permitted only when the Close price is strictly above the EMA on all three timeframes.
-
Sell Trades: Permitted only when the Close price is strictly below the EMA on all three timeframes.
-
Range Filter: If alignment is mixed, the market is classified as range-bound, and entry is paused.
-
-
NY Session Execution Window
-
Restricts trade initiation strictly to specified server hours (e.g., New York session) to avoid low-liquidity slippage and unpredictable Asian/London session ranges.
-
-
Lower Timeframe Level Test & Rejection (M15/M5)
-
Monitors the lower execution timeframe for level interaction.
-
Requires price to touch/penetrate the key level and subsequently close back inside (confirming rejection).
-
Optional setting requires a bullish close for Buys or a bearish close for Sells.
-
-
Virtual Stop Loss (Candle Close SL)
-
To prevent “wick hunting” or fakeouts, the primary Stop Loss operates virtually.
-
A trade is closed at market price only when a candle officially closes past the virtual SL price.
-
-
Step-Trailing Profit Lock & Broker Safety Net
-
As the trade moves into profit, the Virtual SL locks in profits step-by-step (e.g., every 500 points).
-
A hard Broker-Side Safety Net SL is placed far beyond the virtual SL to protect against catastrophic market gaps or internet disconnects.
-
⚙️ Input Parameters Guide
Below is a breakdown of the key external parameters you can configure in MT4:
| Parameter | Type | Default | Description |
InpMagicNumber |
Integer | 20260916 |
Unique identifier for the EA’s orders. |
InpFixedLot |
Double | 0.0 |
Fixed lot size. Set to 0.0 to activate risk-based sizing. |
InpRiskPercent |
Double | 1.0 |
Risk percentage per trade based on Account Balance. |
InpMaxSpreadPoints |
Integer | 1000 |
Maximum allowed spread in points before pausing trades. |
InpSessionStartHour |
Integer | 15 |
NY Session start hour (broker server time). |
InpSessionEndHour |
Integer | 23 |
NY Session end hour (broker server time). |
InpH1LookbackBars |
Integer | 24 |
Lookback period for H1 High/Low key levels. |
InpH4LookbackBars |
Integer | 20 |
Lookback period for H4 High/Low key levels. |
InpTrendMAPeriod |
Integer | 50 |
EMA period used for D1/H4/H1 trend filtering. |
InpEntryTF |
Timeframe | PERIOD_M15 |
Timeframe used for entry confirmation and Virtual SL checks. |
InpTPStepPoints |
Double | 500 |
Points interval for trailing profit lock steps. |
InpUseCandleCloseSL |
Boolean | true |
Enables Virtual SL based on completed candle closes. |
InpUseSafetyNetSL |
Boolean | true |
Enables hard broker-side emergency Stop Loss. |
📥 How to Set Up and Configure Inputs in MT4
-
Install the EA
-
Open MT4 and go to
File→Open Data Folder. -
Open
MQL4→Expertsand paste yourNQ_LineTrade_EA.mq4or.ex4file here. -
Restart or refresh MT4 in the Navigator panel.
-
-
Attach to Chart
-
Open an NQ100 / US100 / Nasdaq chart (recommended timeframe: M15).
-
Drag
NQ_LineTrade_EAfrom the Navigator onto the chart.
-
-
Configure Settings (Inputs Tab)
-
Common Tab: Check
Allow Live TradingandAllow DLL Imports. -
Inputs Tab:
-
Set
InpRiskPercent(e.g.,1.0for 1% risk per trade). -
Adjust
InpSessionStartHourandInpSessionEndHourto match your broker’s server clock for the NY market open. -
Select your preferred entry timeframe in
InpEntryTF(e.g.,M15).
-
-
-
Activate AutoTrading
-
Click the AutoTrading button in the top MT4 toolbar to turn it Green.
-
Verify that the top-right corner of your chart shows a smiley face next to the EA name, alongside the status panel on the chart.
-










Leave a Reply