Ducat EA
User Manual
A complete reference guide for configuring and operating the Ducat Expert Advisor on MetaTrader 5. Start with the Quick Start Guide to get live in minutes, then use the Input Parameters and Safety Systems sections as your ongoing reference.
Quick Start Guide
Follow these steps to have Ducat live and trading in under ten minutes. The strategy is pre-configured โ for most users, the only things you need to set are your lot sizes, magic number, and broker symbol names if they differ from the defaults.
Step 1 โ Add the Default Symbols to Market Watch
Ducat needs each configured instrument to be available in MetaTrader 5's Market Watch before it can trade them. The five default symbols are:
Open Market Watch (Ctrl+M), right-click anywhere in the list, and choose Show All โ or right-click and search for each symbol individually to add it.
SP500, US500.cash, or SPX500m. The DAX may be listed as DE40 or GER40.cash. Note the exact names your broker uses before proceeding to Step 3.
Step 2 โ Open a Chart and Attach the EA
-
Open any chart in MetaTrader 5 Ducat operates independently of the chart it is attached to โ the chart symbol and timeframe do not affect trading behaviour. An H1 or H4 XAUUSD chart is a practical choice, as it keeps the on-chart grid lines visible for your primary instrument.
-
Drag Ducat onto the chart Find Ducat in the Navigator panel under Expert Advisors and drag it onto the chart, or double-click it. The EA Properties dialog will open at the Inputs tab.
Step 3 โ Configure the Inputs
-
Update symbol names if your broker uses different names In the Inputs tab, update S1_Symbol through S5_Symbol to match your broker's exact Market Watch names. If any slot is not needed, clear its symbol field or set its Enable toggle to false.
-
Set your Initial Lot Sizes Set S1_Lot through S5_Lot to your desired base lot size for each instrument. This is your most important risk decision. Start conservatively โ the defaults are intentionally small and are intended for an account size of up to $10,000. See the Position Sizing section for full guidance.
-
Set a unique Base Magic Number Choose any integer not used by other EAs on your account (e.g. 6000). Ducat assigns magic numbers sequentially from this base, one per symbol slot. If running multiple EAs, space them at least 10 apart.
-
Enable Algorithmic Trading and click OK In the Common tab, ensure "Allow Algorithmic Trading" is checked. Click OK. The smiley face icon should appear in the top-right corner of the chart โ this confirms the EA is running.
-
Verify the control panel The Ducat control panel will appear in the top-left of the chart. All enabled symbols should show a valid status. If any symbol is missing or shows an error, recheck its name against Market Watch.
The Control Panel
When Show Info Panel is enabled, Ducat displays a live overlay in the top-left corner of your chart โ a real-time snapshot of every active symbol without needing to open any other window. Below is an example of what it looks like during live operation.
| Symbol | Status | Steps | Live P&L | Next Grid | Price | TP |
|---|---|---|---|---|---|---|
| XAUUSD | DISABLED | โ / 5 | โ | โ | โ | โ |
| US500 | MONITORING | โ / 6 | โ | โ | 5,782.30 | โ |
| GER40 | BUY | 3 / 5 | โ$41.20 | VSL ARMED | 21,304.5 | 21,588.0 |
| USDJPY | WAIT 18Hr42Min | 1 / 7 | +$0.00 | 152.240 | 154.811 | 155.637 |
| USDCHF | DISABLED | โ / 4 | โ | โ | โ | โ |
| Element | Description |
|---|---|
| Title bar | EA name and version, plus a live count of active symbol slots out of the configured maximum. |
| Total Live P&L | Combined unrealised profit or loss across all open positions managed by Ducat, including accrued swap. Updated on every tick. Green when positive, red when negative. |
| Closed P&L | Cumulative realised profit or loss from all trades closed by Ducat since its first initialisation on this account, including swap and commission. Refreshed every 30 seconds. |
| Scale / Hard SL row | Shows the current balance scaling ratio and Hard Stop Loss status. The colour shifts from blue โ orange โ red as the drawdown approaches the limit. |
| Drain button | Top-right toggleable button. When activated, no new grids start โ existing grids run to completion. See the Hard Stop Loss section for Drain Mode details. |
Symbol Row Columns
| Column | Description |
|---|---|
| Symbol | The instrument name. If balance scaling is active and the effective lot differs from the configured lot, the current effective lot appears in brackets. |
| Status | Current operating state of this symbol slot. See the Status Indicators table below. |
| Steps | Number of open positions vs the maximum for this symbol (e.g. 2/5). Badge colour shifts from green โ orange โ red as the grid fills. |
| Live P&L | Unrealised profit or loss for this symbol's open positions only, in account currency. |
| Next Grid | The price at which the next grid position will open. Shows VSL ARMED when the grid is at maximum depth. |
| Price | Current mid-price. Green when price is on the profitable side of the basket's weighted average entry; red when on the losing side. |
| TP | The price at which the virtual take profit fires and all positions in the basket close simultaneously. |
Status Indicators
| Status | Meaning |
|---|---|
| BUY | An active long grid is running on this symbol. Positions are open. |
| SELL | An active short grid is running on this symbol. Positions are open. |
| WAIT Xh Xmin | A grid is active and a position was recently opened. The EA is in cooldown before the next grid level can be added. Time shown is the remaining market-hours wait. |
| MONITORING | No grid is open. The EA is monitoring market conditions and waiting for entry conditions to be met before starting a new grid. |
| DRAINED | Drain Mode is active. No new grids will start. Any open grid continues normally to completion. |
| VOL PAUSE ~Xh | A volatility protection event occurred. Trading is paused for the duration shown. See the Volatility Protection section. |
| DISABLED | This slot has been disabled in the input settings. |
| DEACTIVATED | The Hard Stop Loss triggered. All trading has ceased. Remove and re-attach the EA to resume. |
Input Parameters
This section documents every user-configurable input in Ducat v1.40. Click any parameter to expand its full description.
An integer that MetaTrader 5 attaches to every order placed by Ducat, allowing it to identify and manage its own trades separately from manual orders or other EAs. Each symbol slot is assigned a sequential magic number from this base: Slot 1 uses the base number exactly, Slot 2 uses base+1, up to Slot 5 at base+4.
When true, the real-time information panel is rendered on the chart. When false, the panel is hidden and no panel objects are created or updated. Disabling the panel has no effect on the EA's trading logic whatsoever.
When left blank, Ducat labels each order with its standard format โ the EA name, symbol, direction, and grid step number (for example, Ducat US500 Buy S2). Entering any text here replaces the entire comment on every order with whatever you type.
This setting is purely cosmetic and has no effect on trading logic. It is most useful when running multiple EAs on the same account and you want to distinguish Ducat's trades in the trade history or for reporting purposes.
When enabled, Ducat adjusts all lot sizes proportionally as your account balance grows or shrinks from a starting reference point. The reference balance is recorded the first time Ducat initialises on the account and stored in a MetaTrader 5 Global Variable so it persists across restarts.
Example: if the starting balance is $10,000 and you configure an initial lot of 0.01 for XAUUSD, then once the account grows to $12,000 the raw scaled lot would be 0.012. If it falls to $8,000 the raw scaled lot would be 0.008. The current effective lot for each symbol is displayed in brackets next to the symbol name in the panel whenever it differs from the configured value.
However, brokers enforce a minimum volume step for each instrument โ on XAUUSD this is typically 0.01 lots, meaning valid lot sizes are 0.01, 0.02, 0.03, and so on. A raw scaled value of 0.012 cannot be placed, so Ducat rounds it down to the nearest valid step: 0.01. This means scaling only produces a visible change in lot size once the balance has grown enough to cross a full volume step. On instruments with a finer volume step (such as forex pairs at 0.001 lots) the scaling effect is more granular and responsive. The practical consequence is that on XAUUSD, balance scaling has no real effect until the account has grown by at least 100% โ at which point the lot would step up from 0.01 to 0.02.
Resetting the Scaling Reference Balance
The reference balance is stored in a MetaTrader 5 Global Variable named DC_StartBalance_ACCOUNTNUMBER (where ACCOUNTNUMBER is your MT5 login number โ for example, DC_StartBalance_12345678). To update it, go to Tools โ Global Variables (or press F3), find the variable, and set it to your desired new reference balance. The change takes effect immediately on the next tick โ no EA restart is required.
You may want to reset this baseline if your account balance has grown significantly and you want lot sizes to be calculated from the new higher level rather than the original starting point, or conversely if a drawdown has reduced your balance and you want to recalibrate the scaling to the current reality rather than chasing a higher historical reference.
Sets a maximum allowable drawdown as a percentage of the session starting balance โ the account balance recorded when Ducat was last initialised. If the current account equity falls below this threshold, Ducat immediately closes all open positions across all symbols and permanently deactivates itself for the session. No further trades are placed until the EA is removed and re-attached.
Example: a value of 15.0 means all trading halts if the floating equity drawdown from the session start exceeds 15%. With a $10,000 session start balance, the EA shuts down if equity drops below $8,500.
When active, the system status bar in the panel displays the current drawdown percentage alongside the threshold, and changes colour as it approaches โ orange at 50%, red at 80%. Setting this to 0 disables the feature entirely.
By default, every time you remove and re-attach the EA, the session start balance used by the Hard Stop Loss resets to whatever the account balance is at that moment. If the account has taken a loss, this effectively lowers the safety threshold relative to the original balance.
When this option is enabled, the session start balance is stored in a MetaTrader 5 Global Variable and survives restarts, VPS reboots, and re-attachments. The Hard Stop Loss threshold stays anchored to the same original balance until you manually clear the stored value.
This is particularly useful in the scenario where the Hard Stop Loss triggered, you re-attach to resume, and you want the threshold to remain based on the pre-drawdown balance rather than the reduced post-drawdown balance โ preventing the safety net from silently drifting lower each time you restart.
DC_SessionBal_ACCOUNTNUMBER. The EA picks up the change on the next restart.Ducat supports up to five symbol slots (S1 through S5). Each slot has three user inputs. All strategy parameters โ direction bias, entry timing, grid mechanics, and profit targets โ are pre-configured per slot and fixed in the EA.
| Slot | Default Symbol | Default Lot | Enabled | Instrument |
|---|---|---|---|---|
| S1 | XAUUSD | 0.01 | No | Gold vs US Dollar โ disabled by default, enable manually if desired |
| S2 | US500 | 1.00 | Yes | S&P 500 index โ verify name with your broker |
| S3 | GER40 | 0.10 | Yes | German DAX index โ verify name with your broker |
| S4 | USDJPY | 0.06 | Yes | US Dollar vs Japanese Yen |
| S5 | USDCHF | 0.03 | No | US Dollar vs Swiss Franc โ disabled by default, enable manually if desired |
When set to false, this slot is completely ignored โ no monitoring occurs, no positions are opened, and the slot shows as DISABLED in the panel. Disabling unused slots is recommended to avoid unnecessary resource consumption.
You can also effectively disable a slot by clearing the symbol name field. Both approaches have the same result.
In v1.40, Slots 1 (XAUUSD) and 5 (USDCHF) are both disabled by default. To activate either, set S1_Enabled = true or S5_Enabled = true respectively. If you are upgrading from an earlier version and have open positions on either symbol, enable the relevant slot before attaching v1.40 so the EA can recover and continue managing those positions.
Enter the exact symbol name as it appears in your broker's Market Watch, including any suffix your broker appends โ for example US500.cash, GER40m, or XAUUSDz.
If the symbol is not found in Market Watch at startup, Ducat will attempt to add it automatically. If it still cannot be found, the slot will be skipped and logged as a failed initialisation โ all other slots continue to operate normally.
The lot size used for the opening position of each grid cycle on this symbol. This is the most important risk parameter you will configure โ it directly determines base exposure on this instrument, and all subsequent grid additions are sized relative to it.
Before setting this, understand that a fully loaded grid represents a meaningfully larger total exposure than this initial lot alone. Refer to the FAQ for guidance on calculating your maximum theoretical exposure per symbol.
If balance scaling is enabled, this value serves as the reference from which scaled lots are calculated. The effective lot in use is always visible in the panel.
Each symbol slot has an independent maximum spread threshold. When the live spread exceeds the configured limit, both new grid entries and grid additions on that slot are skipped until conditions normalise. Position management โ take profit, stop loss, and emergency closes โ is never blocked by the spread filter.
Sets the maximum spread, measured in points (the instrument's minimum price movement), at which Ducat will open new positions on this symbol. If the live spread exceeds this value at the moment of an intended entry or grid addition, that specific trade is silently skipped โ no order is placed, and no log noise is produced. The EA checks again on the next candle or tick as normal.
Default thresholds are pre-set for each instrument slot and calibrated to typical ECN conditions. You may need to widen these if your broker consistently shows higher spreads, particularly during the Asian session or around rollover. Setting a slot's value to 0 disables the filter entirely for that slot.
New in v1.40. An optional feature that monitors active baskets as each symbol's daily session approaches the close. If a basket is in net profit at that point, Ducat closes it early to lock in the gain before overnight swap charges are applied.
When enabled, Ducat begins monitoring each active symbol during the window before its daily trading session closes. The check evaluates the combined profit and accrued swap of all open positions on that symbol. If the net result is positive, all positions are closed immediately.
If the basket is not yet in net profit when the window opens, no action is taken โ the basket continues to run normally and the standard virtual take profit or stop loss closes it as usual.
After a pre-rollover close, the slot will not open a new grid for the remainder of that calendar day. Normal trading resumes the following day.
Sets the window, in minutes, before the end of the trading session during which Ducat checks whether a basket should be closed. A value of 30 means the check begins 30 minutes before the session closes.
During this window, the check runs on every new candle. The first moment the basket shows a positive net result, the close fires. If the basket never turns positive within the window, it is left open and continues under normal management.
Hard Stop Loss & Drain Mode
The Hard Stop Loss is an account-level emergency mechanism that shuts down all trading if the session drawdown exceeds a configured threshold. It operates independently of individual grid exits and is the final line of defence for your account.
When set to any value greater than zero, Ducat records the account balance at initialisation as the session start balance. On every tick, it calculates the current equity drawdown as a percentage of that balance. If the drawdown equals or exceeds the configured threshold, Ducat immediately closes all open positions across every symbol and deactivates itself โ the panel displays a full DEACTIVATED state and no further trades are placed for the remainder of the session.
To resume, remove the EA and re-attach it. By default, the session balance resets to the current account balance at that point. If you have enabled Retain Drawdown Baseline on Restart, the original session start balance is preserved across restarts โ see the Position Sizing section for details.
Panel Drawdown Colour Coding
| Colour | Drawdown Level | Meaning |
|---|---|---|
| Blue | Below 50% of threshold | Normal operation. No action needed. |
| Orange | 50โ80% of threshold | Elevated. Consider reviewing open grids. |
| Red | Above 80% of threshold | Hard Stop Loss is imminent if the drawdown continues. |
Drain Mode
The Drain button in the top-right corner of the control panel provides a softer alternative to an abrupt shutdown. When activated:
- No new grids will start on any symbol.
- Any grids already open continue to run normally, closing at their virtual take profit or virtual stop loss as usual.
- Once all open grids have closed, the EA becomes fully idle without being deactivated.
- Drain Mode can be toggled off at any time to allow new grids to start again.
Use Drain Mode when you want to wind down gracefully โ before a major scheduled news event, during account maintenance, or when preparing to remove the EA โ without forcing any open positions closed at an arbitrary moment.
Grid State Recovery
If MetaTrader 5 restarts or the EA is removed and re-attached while positions are open, Ducat automatically recovers. On initialisation it scans all open positions for its magic numbers, reconstructs the grid state โ direction, step count, last entry price โ and resumes managing those positions as normal. No manual action is required.
Volatility Protection
Ducat includes a built-in volatility protection system that monitors each symbol for extreme short-term price moves. This system is always active and cannot be disabled. Its thresholds are fixed and pre-calibrated.
All detection thresholds and pause durations are pre-calibrated and fixed within the EA. These values are not disclosed or configurable.
Sequence of Events
-
Detection On each tick, Ducat monitors each active symbol for extreme short-term price moves. If price movement breaches the pre-calibrated internal threshold, the protection triggers.
-
Emergency close If any positions are open on the affected symbol, they are closed immediately at market.
-
Pause state begins The symbol enters a pause state. No new positions will be opened. The panel shows the approximate remaining time.
-
Automatic resumption When the pause period has elapsed, it lifts automatically and the EA resumes normal monitoring. No action is required from you.
The pause start time is stored in a MetaTrader 5 Global Variable tied to each symbol and magic number. This means the pause survives EA restarts, chart reloads, and VPS reboots โ protection is never accidentally bypassed by a platform restart.
DC_VolPause_SYMBOLNAME_MAGICNUMBER and delete it or set it to 0. The EA picks up the change on the next tick.
Margin Safety
Ducat includes two independent margin protection levels that operate automatically at all times. Both thresholds are fixed and cannot be configured.
| Level | Threshold | Action |
|---|---|---|
| Warning | 200% | New grid additions are suspended on all symbols until margin recovers above 200%. Existing open positions continue to be managed and will close normally at their take profit or stop loss. |
| Emergency | 75% | All open positions are closed immediately across all symbols. This is a last-resort action that fires regardless of grid state, volatility pause, or any other condition. |
The warning level acts as a soft circuit breaker โ it prevents Ducat from deepening exposure when the account is already under margin stress, buying time for a market recovery or for manual intervention. The emergency level should never be reached during normal operation.
In addition to these account-level checks, Ducat validates free margin individually before placing each trade. If the margin required for a new position would exceed available free margin, that specific trade is skipped.
Chart Lines Reference
When a grid is active on the symbol displayed on the current chart, Ducat draws three price reference lines directly on the chart. These update in real time and are removed when the grid closes.
| Line | Colour | Description |
|---|---|---|
| Next Grid Entry | Orange ยท Solid | The exact price at which the next grid position will be added. Hover over the line to see the grid level number and total levels possible. Disappears once the grid is at maximum depth. |
| Virtual Take Profit | Blue ยท Solid | The price at which all basket positions close for profit simultaneously. Hover to see the target price, current weighted average entry, and the take profit percentage. |
| Virtual Stop Loss | Red ยท Solid | Appears only when the grid is at maximum depth. If price reaches this level, all positions close immediately as a safety exit. Hover to see the exact price and the maximum position count. |
If you want grid lines visible across all five symbols simultaneously, the only way to achieve this is to run five separate instances of Ducat โ one attached to each symbol's chart โ with only a single symbol slot enabled per instance (the one matching the chart it is on). Each instance would need its own unique Base Magic Number range to avoid conflicts. This is purely a display preference; a single instance of Ducat managing all five slots trades and monitors all symbols identically โ the lines for non-active charts simply are not drawn.
Glossary
| Term | Definition |
|---|---|
| Grid | A series of positions opened at staggered price levels in the same direction, managed and exited as a single basket. |
| Grid Depth / Steps | The current number of open positions in an active grid. A depth of 3 means three positions are open out of the maximum allowed for that symbol. |
| Weighted Average Entry (WAP) | The average entry price of all positions in the grid basket, weighted by their individual lot sizes. Represents the blended cost basis of the basket. |
| Virtual Take Profit (VTP) | A profit target monitored in EA logic rather than placed as a broker order. When the total floating profit of the basket reaches the target level, all positions close simultaneously. |
| Virtual Stop Loss (VSL) | A safety exit that activates when the grid has reached its maximum depth and no further positions can be added. If price then moves a further grid-step distance against the basket from the last entry, all positions close immediately to limit the loss. |
| Hard Stop Loss (HSL) | An account-level drawdown limit, entirely separate from the Virtual Stop Loss. When the session equity drawdown percentage reaches the configured threshold, the EA closes all positions across all symbols and deactivates itself for the session. |
| Session Start Balance | The account balance recorded at EA initialisation. Used as the reference for Hard Stop Loss drawdown calculations and for balance scaling ratios. |
| Drain Mode | A panel-toggled state that blocks new grids from starting while allowing any currently open grids to run to completion. Used for graceful wind-down without forcing positions closed. |
| Magic Number | A unique integer attached to every order placed by the EA. Allows MetaTrader 5 to distinguish between orders from different EAs or manual trades on the same account. |
| Market Hours | Trading hours excluding weekends. Ducat measures cooldown and volatility pause durations in market hours so timing is consistent regardless of where weekends fall. |
| Cooldown | A minimum waiting period in market hours that must elapse after each grid addition before the next level can fire. Prevents the grid from stacking rapidly during fast one-directional moves. |
| Margin Level | Account equity as a percentage of the margin currently used to support open positions. A margin level of 200% means equity is double the required margin. |
| Balance Scaling | An optional feature that adjusts all lot sizes proportionally as the account balance grows or shrinks from the session start balance. |
| Swap Avoidance | An optional feature that monitors active baskets as each symbol's daily session approaches the close. If the basket is in net profit (including accrued swap), Ducat closes it before the overnight rollover to avoid paying negative swap charges. USDJPY is always excluded as long positions on that pair earn positive swap. |
| Swap / Rollover | A charge (or credit) applied by the broker to any position held open past the daily session close, reflecting overnight interest rate differentials. On most instruments, holding overnight costs money and erodes floating profit. |
Support
All purchases include access to ongoing updates, priority support, and an invite to the Starpoint Trading private community.
Please include your broker name, account type (ECN / STP / market maker), and a brief description of the issue. Screenshots of the EA's Experts log tab in MetaTrader 5 are always helpful for diagnosing initialisation problems.
Starpoint Trading โ Algorithmic systems built for the serious retail trader.