Brokeret LogoDocs
Plugins / Hedge Account/Parameters

Parameters

Configuration parameters and options for the Hedge Account plugin.

Plugin Parameters

Configure these parameters in MT5 Administrator under the plugin settings.

ParameterTypeDefaultDescription
API_KeyStringdefaultAPI key for REST endpoint authentication
API_PortString8445HTTP API listening port
Mapping_1String(empty)Hedge mapping rule (see format below)
Mapping_2String(empty)Hedge mapping rule
Through Mapping_8
Mapping_8String(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:

FieldDefaultDescription
modemirrormirror or net
directionsamesame or reverse
volume_mult1.0Volume multiplier (e.g. 0.5 = half volume)
symbols*Comma-separated symbols or * for all
min_vol0Minimum lot size threshold
priority0Higher 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:

FieldTypeDescription
source_group_maskStringWhich client groups to monitor (supports * wildcard)
hedge_loginIntegerTarget hedge account login number
reverseBooleantrue for reverse direction, false for same direction
hedge_modeStringmirror or net
volume_multiplierFloatVolume scaling factor (1.0 = exact, 0.5 = half)
symbol_filterStringComma-separated symbols or * for all
min_volumeFloatMinimum lot size threshold
priorityIntegerHigher priority mappings are matched first

Fallback Behavior

💡
TipPlugin parameter mappings (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:

  1. Comment check — Deals with a comment starting with ha: are automatically skipped
  2. Hedge login check — Deals originating from known hedge account logins are skipped

Next Steps