Parameters
Configuration parameters and options for the Hedge Account plugin.
Plugin Parameters
Configure these parameters in MT5 Administrator under the plugin settings.
| Parameter | Type | Default | Description |
|---|---|---|---|
API_Key | String | default | API key for REST endpoint authentication |
API_Port | String | 8445 | HTTP API listening port |
Mapping_1 | String | (empty) | Hedge mapping rule (see format below) |
Mapping_2 | String | (empty) | Hedge mapping rule |
| … | … | … | Through Mapping_8 |
Mapping_8 | String | (empty) | Hedge mapping rule |
Mapping Format
Each Mapping_N parameter uses a pipe-delimited format:
group_mask | hedge_login | mode | direction | volume_mult | symbols | min_vol | priority
Only the first two fields are required. Defaults for omitted fields:
| Field | Default | Description |
|---|---|---|
mode | mirror | mirror or net |
direction | same | same or reverse |
volume_mult | 1.0 | Volume multiplier (e.g. 0.5 = half volume) |
symbols | * | Comma-separated symbols or * for all |
min_vol | 0 | Minimum lot size threshold |
priority | 0 | Higher priority mappings are matched first |
Examples
Basic Mirror
real\vip\* | 5001
Mirror all VIP group trades to account 5001 with default settings (mirror mode, same direction, 1:1 volume).
Net Mode with Half Volume
real\std\* | 5002 | net | same | 0.5
Aggregate standard group trades as net positions on account 5002 at 50% volume.
Reverse Hedge
real\losers\5 | 5003 | mirror | reverse
Reverse-hedge a specific group — trades in the hedge account go in the opposite direction of client trades.
Mapping Object Fields
When managing mappings via the REST API, each mapping object contains these fields:
| Field | Type | Description |
|---|---|---|
source_group_mask | String | Which client groups to monitor (supports * wildcard) |
hedge_login | Integer | Target hedge account login number |
reverse | Boolean | true for reverse direction, false for same direction |
hedge_mode | String | mirror or net |
volume_multiplier | Float | Volume scaling factor (1.0 = exact, 0.5 = half) |
symbol_filter | String | Comma-separated symbols or * for all |
min_volume | Float | Minimum lot size threshold |
priority | Integer | Higher priority mappings are matched first |
Fallback Behavior
Mapping_1 through Mapping_8) are used only when no API-created mappings exist. Once you create mappings via the REST API, those take precedence and the parameter-based mappings are ignored.API-created mappings are persisted to BrokeretHedgeAccount_mappings.dat next to the DLL and survive server restarts. Changing plugin config parameters in MT5 Admin triggers an immediate live reload.
Recursion Prevention
The plugin prevents infinite hedge loops through two mechanisms:
- Comment check — Deals with a comment starting with
ha:are automatically skipped - Hedge login check — Deals originating from known hedge account logins are skipped
Next Steps
- API Reference — Manage mappings, view logs, and monitor stats via REST
- Introduction — Back to the plugin overview