Routing Rules
PrimeXM Gateway routing rules are comprised of the following parameters, sec (symbol path or security), sym (symbol), g (group), c (client login), and color (client login color) which all follow the MetaQuotes conditions and acc (the trading Account) that is XCore specific.
| Parameters | Description |
|---|---|
sec |
MT5 security or symbol path. Supports comma-separated paths; masks can be * or end with \*.sec=* — all securities selected for Gateway processing.sec=Forex\* — paths under Forex\*.sec=!Forex\*,* — all paths except Forex\*.sec=!Forex-MET\*,Forex\* — paths under Forex\*, excluding Forex-MET\*. |
sym |
MT5 symbol name or pattern. Supports comma-separated patterns. A mask cannot be only * or end with \*.sym=EURUSD — the EURUSD symbol.sym=*.pro — symbols with the .pro suffix.sym=C*\Fo*x*\EUR* — symbols beginning with EUR, under paths beginning with Fo and containing x, within a path beginning with C. |
g |
MT5 group name or pattern. Supports comma-separated patterns.g=* — all groups.g=ABC\* — groups matching ABC\*.g=!ABC\*,* — all groups except those matching ABC\*.g=!ABC-*-B,ABC\* — groups matching ABC\*, excluding names beginning with ABC- and ending with -B. |
c |
MT5 client login. Supports one login or comma-separated logins.c=10000 — login 10000.c=10000,20000 — logins 10000 and 20000. |
color |
First component (R) of the MT5 client login color displayed as R,G,B, for example color=222 for 222,0,0. See the account color example. |
acc |
XCore Connector Account used for execution, for example acc=Account1. |
MT5 scope: Symbols must be enabled under the Gateway's Symbols tab, and groups must be enabled under its Groups tab. sec=* and g=* match all enabled symbol paths and groups, respectively.
Pattern matching: Avoid patterns ending with ,* because they are inefficient to process. Use more precise patterns, or sec=* and g=* when appropriate. Any pattern other than sec=* or g=* counts as a specific security or group match, respectively.
Match priority
The Gateway checks the following match types in priority order, from 1 to 9. It uses the last matching rule within the first match type that has a match. If none exists, it proceeds to the next priority.
| Priority | Account match | Instrument match |
|---|---|---|
| 1 | Client login (c) |
Symbol (sym) |
| 2 | Client login (c) |
Security (sec) |
| 3 | Client login (c) |
All securities (sec=*) |
| 4 | Group (g) |
Symbol (sym) |
| 5 | Group (g) |
Security (sec) |
| 6 | Group (g) |
All securities (sec=*) |
| 7 | All groups (g=*) |
Symbol (sym) |
| 8 | All groups (g=*) |
Security (sec) |
| 9 | All groups (g=*) |
All securities (sec=*) |
If none of the nine match types has a matching rule, there is no routing match.