NextGen PRO
- Эксперты
- Версия: 2.50
- Обновлено: 25 августа 2026
- Активации: 5
Trend-Following Stop-Order Grid for XAUUSD
Overview
NextGen PRO is a fully automated Expert Advisor built around one simple idea: only trade in the direction the market is already moving, and only add orders when the previous trade cycle is finished.
When the trend is up, it lays a ladder of Buy Stop orders above the market. When the trend is down, it lays a ladder of Sell Stop orders below the market. When price sits between the two moving averages, the market is treated as a range and the EA stays out.
Every position is protected by a money-based stop loss and a money-based trailing stop, both measured in account currency instead of points, so your risk per trade is the same number you set in the inputs no matter which lot size the ladder is using.
Requires a hedging account. The EA manages several positions in the same direction at once, which is not possible on a netting account.
How It Works
1. Trend detection (M5, EMA)
The trend is read from the closed M5 bar, never from the forming bar, so signals do not repaint.
- Close above both EMAs = TREND UP
- Close below both EMAs = TREND DOWN
- Close between the two EMAs = RANGE, and no new orders are placed
The EMA periods are fixed at ** and ** and are always read from M5, so the EA behaves identically no matter which timeframe you attach it to.
2. The stop-order ladder
As soon as a valid trend appears, the EA anchors a ladder at the current price and fills it with stop orders in the trend direction.
- Levels are spaced evenly by the Grid Step value you choose, measured in dollars of price movement, and every level in the ladder keeps that exact spacing.
- Orders are placed as Buy Stop or Sell Stop, so a position only opens when price actually pushes further in the trend direction. The EA never buys into a falling market or sells into a rising one.
- Levels that fall inside your broker's minimum stop distance are skipped automatically instead of producing order errors.
- You can cap how many pending orders sit live in the market at once, which keeps order traffic low on brokers with request limits.
3. Lot progression by batch
The first batch of orders uses your base lot. The next batch adds one more base lot, the next adds another, and so on.
The increase is linear, not martingale — lots grow by a fixed step per batch, they do not double. Batch size is adjustable, so you can make the progression as slow or as aggressive as you want, or switch it off completely by setting the batch size larger than the maximum order count.
4. The dynamic refresh engine
Most grid robots keep firing at price levels that were calculated hours ago. NextGen PRO re-anchors its ladder to the live market, but only when it is safe to do so.
While a trade is open, the ladder is frozen. The EA will not delete, move, or re-price a single pending order while a position in that direction is running, no matter how far the market retraces. Your open trade keeps the exact ladder it was born with.
When the cycle ends, the ladder refreshes. The moment the last position of a cycle closes — at stop loss, at trailing stop, at break-even, whichever comes first — the EA checks the trend again. If the trend is unchanged, it cancels the old levels and lays a brand new ladder around the current market price, with the lot progression reset to the base lot.
Retracement re-anchoring while flat. If no trade is open and the market pulls back by your chosen retracement distance, the ladder is re-laid closer to price so the EA is not left waiting behind a level the market has abandoned.
Trend reversal handling. If the trend flips, all pending orders of the old direction are cancelled and a fresh ladder is built on the new side.
A cooldown timer prevents the ladder from being re-laid repeatedly during noisy ticks.
5. Money-based risk management
Dollar stop loss. You set the loss in account currency for a 0.01 lot, and the EA scales it automatically for every larger position, so a 0.05 lot trade risks exactly five times that amount. No point calculations, no digit confusion between brokers.
Dollar trailing stop. Trailing activates once a position reaches your chosen profit, then follows the highest profit the trade has reached, at your chosen distance behind it. Also set in account currency.
Both are managed by the EA rather than sent to the broker as visible levels, which keeps your protective levels off the server. This means the EA must be running for them to work, so a VPS is strongly recommended.
6. Daily limits and protective shutdown
Daily loss and daily profit limits are measured as a percentage of the equity recorded at the start of the trading day.
When a limit is reached, the EA immediately cancels every pending order and closes every losing position, then stops opening anything new. Positions that are in profit are kept and managed with the trailing stop, so a winning trade is not thrown away just because a daily target was reached. Everything resets automatically at the start of the next trading day.
7. Weekend protection
Set a Friday stop time and a Monday resume time. Between them, the EA cancels pending orders, closes losing trades and opens nothing new. This keeps you out of the weekend gap while still letting profitable trades run into the close under trailing protection.
Times are read from your terminal clock, so you can set them in your own local time.
8. Built for real-world use
Timeframe switching is safe. Change the chart timeframe or edit an input and the EA restores its ladder instead of deleting your live orders and starting over.
Magic number isolation. The EA only ever touches its own orders and positions, so you can trade manually on the same account, or run another EA alongside it.
Clean removal. Taking the EA off the chart cancels its pending orders automatically, leaving nothing orphaned behind.
Detailed logging. Every order, refresh, freeze and stop-out is written to the journal with its reason, so you can audit exactly why the EA did what it did.
9. On-chart dashboard
A compact panel in the top-left corner shows, in real time:
| Row | Meaning |
|---|---|
| Market | TREND UP, TREND DOWN or RANGE |
| Grid | ARMED (ladder live, side flat), FROZEN (position open, ladder locked), REFRESH (re-anchor queued), IDLE |
| Session | Trading window status |
| Lot | Lot size of the current batch |
| Trades / Pend | Open positions and live pending orders |
| Running P/L | Floating profit of the EA's own positions |
| Spread | Current spread in points |
| Bot | Whether algorithmic trading is enabled in the terminal |
Requirements
| Item | Requirement |
|---|---|
| Account type | Hedging (required) |
| Symbol | Designed and tuned for XAUUSD / Gold. Grid step, stop loss and trailing distances are set in dollars of price movement, so they must be re-tuned for any other instrument. |
| Timeframe | Any — the trend is always read from M5,M15, M30 |
| Broker | Low spread on gold, stop-order pending orders allowed |
| Platform | MetaTrader 5, algorithmic trading enabled |
| Hosting | VPS strongly recommended — stop loss and trailing stop are managed by the EA and only work while it is running |
| Deposit | Size it to the ladder you configure. Each additional level can add an open position, so maximum exposure is your maximum order count multiplied by the lot progression. Check the margin requirement on demo before going live. |
Input Parameters
General Settings
| Parameter | Description |
|---|---|
| MagicNumber | Unique ID for this EA's orders. Change it if you run more than one copy on the same account. |
| ShowVerboseLogs | Write detailed journal messages for every action. Keep it on while testing, switch it off in live trading to reduce log size. |
Lot Size Settings
| Parameter | Description |
|---|---|
| LotSize | Base lot for the first batch of orders, and the increment added to each following batch. |
Stop Loss Settings
| Parameter | Description |
|---|---|
| UseDollarSL | Enable the money-based stop loss. |
| StopLossDollars | Loss in account currency at which a 0.01 lot position is closed. Automatically scaled up for larger lots. |
Trailing Stop Settings
| Parameter | Description |
|---|---|
| UseTrailingStop | Enable the money-based trailing stop. |
| TrailingStartDollars | Floating profit a position must reach before trailing activates. |
| TrailingStopDollars | Distance in account currency kept behind the highest profit the position has reached. The position is closed if profit falls back to that level. |
Risk Management
| Parameter | Description |
|---|---|
| UseDailyLossLimit | Enable the daily loss shutdown. |
| UseDailyProfitLimit | Enable the daily profit shutdown. |
| DailyLossPct | Percentage drop from the day's starting equity that triggers shutdown. |
| DailyProfitPct | Percentage gain from the day's starting equity that triggers shutdown. |
| ClosePositionsOnDisable | Close positions when the EA is disabled. |
Pending Order / Grid Settings
| Parameter | Description |
|---|---|
| GridStepDollars | Distance in dollars of price movement between two ladder levels. |
| OrdersPerBatch | How many orders share the same lot size before the lot is increased by one step. |
| MaxOpenTradesPerDir | Maximum combined pending orders and open positions per direction. This is your hard exposure ceiling. |
| MaxPendingAhead | Maximum pending orders sitting live in the market at once. New levels are added as old ones fill. Set to 0 for no limit. |
Dynamic Grid Refresh
| Parameter | Description |
|---|---|
| UseRetracementRefresh | Re-anchor the ladder to the current price after a retracement. Only ever applies when no position is open in that direction. |
| RetracementDollars | Size of the pullback, in dollars of price movement, that triggers the re-anchor. |
| RefreshAfterCycleEnd | Re-anchor the ladder to the current price once the last position of a cycle has closed and the trend is unchanged. |
| RebaseCooldownSeconds | Minimum time between two re-anchors. Prevents repeated rebuilding on noisy ticks. |
| KeepGridOnSignalLoss | Keep pending orders alive if the trend temporarily becomes a range while a position is still open. Recommended on, so an open trade is never stranded without its ladder. |
Weekend Restriction Settings
| Parameter | Description |
|---|---|
| UseWeekendFilter | Enable the weekend shutdown. |
| FridayStopTime | Terminal time (HH:MM) at which Friday trading stops. |
| MondayResumeTime | Terminal time (HH:MM) at which Monday trading resumes. |
Getting Started
- Open a gold chart, attach the EA and enable algorithmic trading.
- Leave the defaults in place for your first demo run and watch the Grid row on the dashboard so you can see the freeze and refresh cycle working.
- Set your stop loss and trailing distances to match the volatility of your broker's gold feed.
- Match your grid step and maximum order count to your account size before going live.
Important Risk Notice
This EA uses a grid of pending orders with a lot size that increases per batch. Several positions in the same direction can be open at the same time, and a strong move against an open ladder will produce a drawdown proportional to the number of levels filled. The money-based stop loss limits the loss of each individual position, not the combined exposure of the whole ladder.
Trading involves risk of loss. Past results, including any backtest, do not guarantee future performance. Test every settings change on a demo account first and never risk money you cannot afford to lose.
