MT4 & MT5 EA User Guide — Part 2: Trade Management Explained — Basket Closing, Grid & Hedging
About This User Guide
This guide explains the shared settings and trade management features of the MetaTrader 4 and MetaTrader 5 robots listed below. It is organized into a series of articles covering installation, configuration, trade management, filters, testing, and troubleshooting.
Each robot uses its own built-in trading strategy. Signal settings, available options, and preset values may differ between products and platform editions. All numerical values in this guide are examples; refer to the individual product description for its entry logic and specific settings.
Robots Covered by This Guide
| Robot | MT5 Version | MT4 Version |
|---|---|---|
| 1. SuperTrend Order Block Robot | MT5 | MT4 |
| 2. RSI Kernel Optimized Robot | MT5 | MT4 |
| 3. Fibonacci Trend Continuation Robot | MT5 | MT4 |
| 4. Volumatic VIDyA Robot | MT5 | MT4 |
| 5. Zero Lag MA Trend Levels Robot | MT5 | MT4 |
| 6. Dual MA Cross Robot | MT5 | MT4 |
This list may be expanded in future updates to include additional robots that use the shared settings described in this guide.
MT4 & MT5 EA User Guide — Part 2: Trade Management Explained — Basket Closing, Grid & Hedging
EA User Guide - all parts
- Part 1: Installation & Risk Controls
- Part 2: Trade Management — Grid & Hedging (this part)
- Part 3: Technical & News Filters
- Part 4: Control Panels & Backtesting
- Part 5: Messages & Troubleshooting
Groups 08-20: volume management, basket closing, breakeven display, Grid, Hedging, commission, entry limits, sessions, weekdays and holiday dates.
Telegram support: @dh99trading
Example values: All values are examples. Presets, signal settings and available controls can differ by EA and platform edition. Use the settings supplied with your product.
08. Volume Management
The base lot method in group 02 is used at the start or when volume management resets. Add, Multiplier and Recover are explained below.
| Setting label | Example value | How to use it |
|---|---|---|
| Volume management mode | None / OFF | Choose OFF, Add, Multiplier or Recover for subsequent entries. This does not replace base-lot sizing in group 02. |
| Lot increment | 0.01 | Lot increment for Add mode. Must comply with the symbol lot rules and lot step. |
| Lot multiplier | 2.0 | Multiplier for Multiplier mode; must be positive. A value of 1 keeps volume unchanged; values above 1 increase lots across the applicable sequence. |
| Maximum managed lot size (0 = unlimited) | 0 | Maximum lot produced by volume management. Zero sets no cap here, but broker limits still apply. This is not the total lot limit for all positions. |
| Mode | Behavior |
|---|---|
| OFF | Do not progress volume through this management feature. |
| Add | Add Lot increment to the previous lot during the applicable losing sequence. For example, 0.01 with an increment of 0.01 can become 0.02 and then 0.03. After a winning trade, return to the initial lot-sizing method. |
| Multiplier | Multiply the previous lot by the selected factor. For example, 0.01 with a factor of 2 can become 0.02 and then 0.04. After a winning trade, return to the initial lot-sizing method. |
| Recover | Calculate lot size from the loss to recover within the selected history and the potential result at the chosen TP. This is not necessarily fixed doubling and does not guarantee recovery of every loss. |
Recover requirements
- Maximum open positions in group 14 must equal 1.
- Enable an individual TP in group 04.
- Grid and Hedging must both be OFF.
- Automatic closing mode in group 09 must be OFF.
- Basket TP and Basket SL in group 09 must both be OFF.
- Check the history range and commission when comparing the recovery amount. Maximum managed lot size caps the calculated lot, which may prevent recovery of the intended amount in a single trade.
09. Closing Rules
The basket contains positions managed under the same symbol and Magic Number. Basket TP/SL evaluates the basket result, separately from individual SL/TP in groups 03-04.
| Setting label | Example value | How to use it |
|---|---|---|
| Basket take-profit mode | None / OFF | Select Basket TP in account currency, balance percentage or Points. None/OFF disables this basket profit target. |
| Basket take-profit value (account currency/%/points) | 100 | Basket TP threshold in the unit selected by its mode. Must be positive when Basket TP is enabled. |
| Basket stop-loss mode | None / OFF | Select Basket SL in account currency, balance percentage or Points. None/OFF disables this basket loss target. |
| Basket stop-loss value (account currency/%/points) | -100 | Basket SL threshold in the selected unit. Must be negative when enabled, for example -100 rather than +100. |
| Automatic closing mode | OFF | Close on a signal or before a new entry. Choose all positions or only the opposing direction. Do not use with Grid or Recover. |
Close on a signal or before a new entry
| Closing option | Timing and scope |
|---|---|
| OFF | Do not close through this signal rule. Other configured exit rules can still apply. |
| Close ALL when signal appears | Close positions in the management scope when the corresponding signal state appears, even if filters have not approved a new entry. |
| Close OPPOSING when signal appears | Close positions in the opposite direction to the new signal, within the management scope. |
| Close ALL before entry | Close positions before the next entry, after entry conditions have been satisfied. |
| Close OPPOSING before entry | Close opposing positions before the next eligible entry. |
Basket TP uses a positive value; Basket SL uses a negative value. Switching between money, percentage and Points changes the unit of the same number. Closing only one direction of a hedge pair can leave the remaining position exposed to price movement.
10. Breakeven Display
This group controls reference lines on the chart. Enable the corresponding exit function in Closing or Trailing Stop to create an exit rule. Displaying a line alone does not close positions.
| Setting label | Example value | How to use it |
|---|---|---|
| Show aggregate breakeven price line | false / Off | Show aggregate basket breakeven. This is a display setting; it does not move SL or close positions. |
| Show basket stop-loss line | false / Off | Show the Basket SL line when the target can be represented as a price. Showing the line does not enable Basket SL. |
| Show basket take-profit line | false / Off | Show the Basket TP line when the target can be represented as a price. Showing the line does not enable Basket TP. |
When total Buy lots equal total Sell lots, the balanced basket may not have one unique breakeven market price. A price reaching a displayed line does not necessarily make a hedged basket break even after costs.
11. Grid
After the initial position, Grid adds positions in the same direction when price moves against the basket. Spacing is measured from the latest Grid position. The order limit includes the initial position.
| Setting label | Example value | How to use it |
|---|---|---|
| Enable grid trading (one grid at a time) | false / Off | Enable additional Grid orders, with one Grid at a time. Configure the order count, spacing, volume and basket exit. |
| Maximum orders per grid (0 = disabled) | 0 | Maximum positions in one Grid, including the initial entry. Zero disables additional Grid orders. Use 2 or more when deliberately running Grid. |
| Grid spacing method | Points | Choose Point spacing or a multiple of the initial SL distance. |
| Buy grid spacing in points | 100 | Spacing for additional Buy Grid positions in Points. Must be positive for Grid by Points. |
| Sell grid spacing in points | 100 | Spacing for additional Sell Grid positions in Points. Must be positive for Grid by Points. |
| Buy grid spacing (stop-loss multiple) | 1 | SL-distance multiplier for Buy Grid spacing. Must be positive and requires an SL method that produces a valid distance. |
| Sell grid spacing (stop-loss multiple) | 1 | SL-distance multiplier for Sell Grid spacing. Must be positive. Do not use with SL = None. |
| Grid lot progression method | Multiplier | Volume progression within the Grid: Add or Multiplier. This is separate from group 08 volume management. |
| Grid lot increment | 0.01 | Lot increment for each Grid step in Add mode. Must be valid for the lot step. |
| Grid lot multiplier | 2.0 | Multiplier for the next Grid position; must be positive. A value of 1 keeps equal lots; values above 1 increase aggregate volume faster. |
Grid requirements
- MT5: use a Hedging account that permits independent positions on the same symbol. MT4: use an account that permits multiple independent market-order tickets; confirm broker order and margin limits.
- Set Maximum open positions in group 14 to 1 for the initial entry cycle. Maximum orders per grid controls the number of positions within the Grid.
- Set Maximum orders per grid to 2 or more. A value of 0 disables additional Grid orders.
- Enable Basket TP or Basket TSL. Basket SL alone does not satisfy the Grid profit-exit requirement.
- Recover, Hedging and Automatic closing mode must be OFF.
- Per-position trailing must be OFF. For Basket TSL, also check the individual SL/TP requirements in group 06.
- When Grid spacing uses SL distance, do not select SL = None.
Illustration: a Buy Grid starting at 100 with a price step of 2 may add a Buy at 98, then 96, if execution conditions are met. A limit of 3 means three positions in total, not three additional positions. This example ignores spread and is not a recommended configuration.
MT5 Hedging is an account type; Hedging in group 12 is an EA strategy. MT5 Grid needs the Hedging account type while group 12 must be OFF. In MT4 there is no corresponding account-type switch: Grid uses separate order tickets and group 12 must still be OFF.
Additional Grid orders follow Grid spacing and volume rules. Do not assume the entry-signal filters block every additional order. On Demo, monitor the initial entry and Grid additions separately.
12. Hedging
Hedging opens an opposite position when an original position reaches its loss threshold. The hedge opens automatically at the threshold with the same lot as the original position. It does not wait for another opposite signal.
Account requirements: MT5 needs a Hedging account to retain the original position and its opposite hedge. On a Netting account, an opposite trade reduces, closes or reverses the existing position. MT4 needs a broker account that permits simultaneous Buy and Sell order tickets and the closing sequence used by the EA. No-hedging or FIFO restrictions can prevent the intended operation.
| Setting label | Example value | How to use it |
|---|---|---|
| Enable hedging | false / Off | Enable an opposite position when an original trade reaches its loss threshold. OFF does not close existing hedges or restore removed SL/TP. |
| Hedging mode | Points | Points measures loss distance from the original entry. SL multiplies the distance from entry to the initial SL. |
| Buy hedge trigger value | 1000 | Threshold for an original Buy; reaching it opens a Sell hedge. It is a Point count in Points mode or an initial-SL multiplier in SL mode. Must be positive while Hedging is ON. |
| Sell hedge trigger value | 1000 | Threshold for an original Sell; reaching it opens a Buy hedge. The unit depends on Hedging mode. Must be positive while Hedging is ON. |
| Original position | Applicable setting | Hedge opened |
|---|---|---|
| Buy | Buy hedge trigger value | Sell, with the same volume as the original Buy. |
| Sell | Sell hedge trigger value | Buy, with the same volume as the original Sell. |
Understand the threshold unit
| Hedging mode | Method | Example |
|---|---|---|
| Points | Threshold = Buy/Sell value x the symbol Point, measured from the original entry in the losing direction. | Point = 0.01 and value = 1000 produce a price distance of 10. |
| SL | Threshold = Buy/Sell value x the distance from entry to the initial SL. | Buy entry at 2350, initial SL at 2340: a value of 0.5 gives a distance of 5; a value of 1 gives a distance of 10. |
When switching from Points to SL, enter suitable values again. The number 1000 in Points does not automatically become an appropriate SL multiplier. In SL mode, 1000 means 1000 times the initial SL distance.
SL/TP and positions after hedging
- Hedging removes broker SL/TP from eligible original positions when they are processed, potentially before the hedge trigger is reached. The hedge is created without individual SL/TP.
- An SL used for lot sizing or as a hedge reference therefore does not guarantee that the original position will close at that SL price. Risk-based sizing no longer ensures a fixed exit loss if the actual SL has been removed.
- A hedge is not hedged again by the same mechanism. An original position with a linked hedge is skipped when creating new hedges.
- Turning Hedging OFF stops new hedges from this feature. It does not automatically close existing pairs or restore removed SL/TP.
- An equal-lot opposite pair does not generate additional profit by itself to recover the locked loss. Spread, commission and swap on both legs still affect the basket.
- Monitor exits through Closing, Basket TSL or the suitable closing controls for your EA. The account must permit independent opposite positions.
Hedging configuration requirements
- Both Buy hedge value and Sell hedge value must be greater than 0 while Hedging is ON. Turn the feature off with Enable hedging = false; do not use 0 to disable just one direction.
- SL mode requires a Stop-loss calculation method other than None.
- Do not combine Hedging with per-position trailing, Recover or Grid.
- Volume progression in group 08 does not mean the hedge itself adds or multiplies lots. The hedge copies the original volume.
13. Commission
Commission settings help breakeven, basket and Recover calculations reflect costs according to the EA calculation method. Use the account currency and the broker charging convention.
| Setting label | Example value | How to use it |
|---|---|---|
| Commission calculation mode | None | Commission calculation for breakeven, basket and Recover. Choose None, account currency per lot or percentage under the EA convention. |
| Commission per lot (account currency or %, by mode) | 0 | Commission rate in the selected mode; cannot be negative. Compare one-side versus round-trip charges with the broker and a Demo trade. |
Commission mode = None disables the selected calculation here; it does not stop broker charges. Confirm whether the quoted commission covers one side or the full opening-and-closing cycle before comparing basket targets.
14. General Trade Filters
These conditions control initial entries and session directions. When using additional-order modes such as Grid or Hedging, also read the rules for that mode.
| Setting label | Example value | How to use it |
|---|---|---|
| Open new trades only at bar open | true / On | true evaluates new entries only on a new candle; false evaluates on Ticks. This does not by itself mean the strategy reads a closed candle. |
| Maximum open positions (0 = unlimited) | 1 | Position-count limit used for entry checks; 0 = unlimited. Grid and Recover require 1. With Hedging, also read the entry-count explanation below. |
| Entry limit per bar (0 = unlimited) | 1 | Entry limit within a bar according to the EA signal-counting rules; 0 = unlimited. Helps control repeat entries while a signal remains active. |
| Max Buy losing streak (0 = off) | 0 | Buy losing-streak limit for subsequent Buy permission; 0 = OFF. It is not a limit on the number of Sell hedges. |
| Max Sell losing streak (0 = off) | 0 | Sell losing-streak limit for subsequent Sell permission; 0 = OFF. With Hedging, read it together with the EA cycle-management rules. |
| Maximum slippage in points (-1 = default) | 10 | Allowed price deviation in Points. A value of -1 uses the level defined by the EA. A small value may restrict execution during fast markets. |
| Maximum spread in points (0 = disabled) | 0 | Maximum spread for a new entry, in Points. Zero disables the spread check; negative values are invalid. |
| Enable trading session filter | false / Off | Enable session filtering from groups 15-18. When OFF, the EA uses Default direction below. |
| Default direction when session filter is disabled | Both (Buy + Sell) | Allowed direction while session filtering is OFF: Buy, Sell, Both or None/OFF. None blocks new entries. |
| Close open positions outside enabled sessions | false / Off | Close positions outside enabled sessions. Applies only with session filtering ON. This closes positions rather than merely blocking entries. |
Hedged pairs may be excluded from the count used for entry checks. Maximum open positions = 1 does not necessarily mean the broker holds only one actual position. Also monitor total positions and total open lots.
Buy/Sell losing-streak limits control entry permission by direction, not the number of times one position can be hedged. Monitor streak status, the history range and Buy/Sell permissions on the panel.
15. Session 1 - Sydney
Example Sydney window: 00:00-08:59 broker server time. Session names are labels; times do not automatically convert to your local timezone or adjust to market daylight-saving schedules.
| Setting label | Example value | How to use it |
|---|---|---|
| Session 1 (Sydney) trading direction | Both (Buy + Sell) | Allowed direction in this session: Buy, Sell, Both or None/OFF. None disables this session as a source of trading permission. |
| Session 1 start hour (server time) | 0 | Session start hour, 0-23 in broker server time. |
| Session 1 start minute (server time) | 0 | Session start minute, 0-59. |
| Session 1 end hour (server time) | 08 | Session end hour, 0-23 in broker server time. For an overnight window, check the date transition on Demo. |
| Session 1 end minute (server time) | 59 | Session end minute, 0-59. |
| Show session 1 zone | true / On | Display the session zone. This changes chart display, not the session trading permission. |
| Show session 1 label | true / On | Display the session label on the chart. |
| Session 1 zone color | 122,204,67 (RGB) | Session-zone color. |
| Session 1 zone transparency (0-100%) | 70 | Zone transparency, 0-100%. Higher values make the zone more transparent. |
When sessions overlap, the session filter combines the permitted directions of active sessions. To check one session in isolation, disable the others. Session zones and labels change only the chart display.
16. Session 2 - Tokyo
Example Tokyo window: 03:00-11:59 broker server time. Session names are labels; times do not automatically convert to your local timezone or adjust to market daylight-saving schedules.
| Setting label | Example value | How to use it |
|---|---|---|
| Session 2 (Tokyo) trading direction | Both (Buy + Sell) | Allowed direction in this session: Buy, Sell, Both or None/OFF. None disables this session as a source of trading permission. |
| Session 2 start hour (server time) | 3 | Session start hour, 0-23 in broker server time. |
| Session 2 start minute (server time) | 0 | Session start minute, 0-59. |
| Session 2 end hour (server time) | 11 | Session end hour, 0-23 in broker server time. For an overnight window, check the date transition on Demo. |
| Session 2 end minute (server time) | 59 | Session end minute, 0-59. |
| Show session 2 zone | true / On | Display the session zone. This changes chart display, not the session trading permission. |
| Show session 2 label | true / On | Display the session label on the chart. |
| Session 2 zone color | 255,148,33 (RGB) | Session-zone color. |
| Session 2 zone transparency (0-100%) | 70 | Zone transparency, 0-100%. Higher values make the zone more transparent. |
When sessions overlap, the session filter combines the permitted directions of active sessions. To check one session in isolation, disable the others. Session zones and labels change only the chart display.
17. Session 3 - London
Example London window: 10:00-18:59 broker server time. Session names are labels; times do not automatically convert to your local timezone or adjust to market daylight-saving schedules.
| Setting label | Example value | How to use it |
|---|---|---|
| Session 3 (London) trading direction | Both (Buy + Sell) | Allowed direction in this session: Buy, Sell, Both or None/OFF. None disables this session as a source of trading permission. |
| Session 3 start hour (server time) | 10 | Session start hour, 0-23 in broker server time. |
| Session 3 start minute (server time) | 0 | Session start minute, 0-59. |
| Session 3 end hour (server time) | 18 | Session end hour, 0-23 in broker server time. For an overnight window, check the date transition on Demo. |
| Session 3 end minute (server time) | 59 | Session end minute, 0-59. |
| Show session 3 zone | true / On | Display the session zone. This changes chart display, not the session trading permission. |
| Show session 3 label | true / On | Display the session label on the chart. |
| Session 3 zone color | 64,172,245 (RGB) | Session-zone color. |
| Session 3 zone transparency (0-100%) | 70 | Zone transparency, 0-100%. Higher values make the zone more transparent. |
When sessions overlap, the session filter combines the permitted directions of active sessions. To check one session in isolation, disable the others. Session zones and labels change only the chart display.
18. Session 4 - New York
Example New York window: 15:00-23:59 broker server time. Session names are labels; times do not automatically convert to your local timezone or adjust to market daylight-saving schedules.
| Setting label | Example value | How to use it |
|---|---|---|
| Session 4 (New York) trading direction | Both (Buy + Sell) | Allowed direction in this session: Buy, Sell, Both or None/OFF. None disables this session as a source of trading permission. |
| Session 4 start hour (server time) | 15 | Session start hour, 0-23 in broker server time. |
| Session 4 start minute (server time) | 0 | Session start minute, 0-59. |
| Session 4 end hour (server time) | 23 | Session end hour, 0-23 in broker server time. For an overnight window, check the date transition on Demo. |
| Session 4 end minute (server time) | 59 | Session end minute, 0-59. |
| Show session 4 zone | true / On | Display the session zone. This changes chart display, not the session trading permission. |
| Show session 4 label | true / On | Display the session label on the chart. |
| Session 4 zone color | 237,26,123 (RGB) | Session-zone color. |
| Session 4 zone transparency (0-100%) | 70 | Zone transparency, 0-100%. Higher values make the zone more transparent. |
When sessions overlap, the session filter combines the permitted directions of active sessions. To check one session in isolation, disable the others. Session zones and labels change only the chart display.
19. Day-of-Week Filter
Allow or block new entries by the server weekday. Enable at least one day. Allowing Saturday or Sunday does not open a symbol when the broker has no trading session.
| Setting label | Example value | How to use it |
|---|---|---|
| Allow trading on Sunday | true / On | Allow evaluation of new entries on Sunday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Monday | true / On | Allow evaluation of new entries on Monday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Tuesday | true / On | Allow evaluation of new entries on Tuesday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Wednesday | true / On | Allow evaluation of new entries on Wednesday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Thursday | true / On | Allow evaluation of new entries on Thursday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Friday | true / On | Allow evaluation of new entries on Friday in broker server time. true does not override the symbol actual trading schedule. |
| Allow trading on Saturday | true / On | Allow evaluation of new entries on Saturday in broker server time. true does not override the symbol actual trading schedule. |
20. Holiday Date Range
The holiday range uses day and month and repeats annually. The example 15 December to 15 January crosses the year-end. Check both endpoints in Strategy Tester.
| Setting label | Example value | How to use it |
|---|---|---|
| Enable holiday date-range filter | false / Off | Enable an annually recurring holiday date range to restrict new entries. |
| Holiday start day (1-31) | 15 | Holiday start day. Together with the start month, it must form a valid calendar date. |
| Holiday start month (1-12) | 12 | Holiday start month, from 1 to 12. |
| Holiday end day (1-31) | 15 | Holiday end day. Together with the end month, it must form a valid calendar date. |
| Holiday end month (1-12) | 01 | Holiday end month, from 1 to 12. The example range crosses from December into January. |
EA User Guide - all parts
- Part 1: Installation & Risk Controls
- Part 2: Trade Management — Grid & Hedging (this part)
- Part 3: Technical & News Filters
- Part 4: Control Panels & Backtesting
- Part 5: Messages & Troubleshooting


