Update group
UpdateGroup¶
Description: Updates an existing trading group. The payload shape is the same as AddGroup.
Request Parameters¶
| Name | Type | Required | Description |
|---|---|---|---|
| group | string | Yes | Group name |
| brand | string | No | Brand namespace for accounts in this trading group |
| account_mode | int | No | Account mode for self-service opening: 0 = DEMO, 1 = REAL |
| public_opening | int | No | Allows customer self-service opening for this group when set to 1 |
| currency | string | Yes | Group base currency |
| enable | int | Yes | Enable flag |
| margin_call | int | Yes | Margin call level |
| margin_mode | int | Yes | Margin mode |
| margin_type | int | Yes | Margin type |
| margin_stopout | int | Yes | Margin stop-out level |
| default_leverage | int | Yes | Default leverage |
| default_deposit | double | Yes | Default deposit |
| secgroups | array | Yes | Security-group overrides |
| secmargins | array | Yes | Symbol margin overrides |
| credit | double | No | Credit value |
| use_swap | int | No | Swap enabled flag |
| hedge_prohibited | int | No | Hedge prohibited flag |
| allow_sl_tp_slippage | int | No | Allows market-price slippage when SL/TP triggers: 1 = enabled, 0 = close exactly at SL/TP level |
| stopout_skip_hedged | int | No | Skip stop-out for hedged positions |
| close_reopen | int | No | Close/reopen flag |
| interestrate | int | No | Interest rate |
| hedge_largeleg | int | No | Hedge large leg mode |
| archive_pending_period | int | No | Archive period for pending orders |
| maxpositions | int | No | Max positions |
secgroups Items¶
Each item updates one GroupRecordSec entry. sec_index is required; all
other fields are optional and default to 0 when omitted.
| Field | Type | Required | Description |
|---|---|---|---|
sec_index |
int | Yes | Symbol security group id from symbol groups |
show |
int | No | Show symbols from this security group |
trade |
int | No | Allow trading for this security group |
execution |
int | No | Execution mode: 0 manual, 1 auto, 2 activity |
comm_base |
double | No | Base commission value |
comm_agent |
double | No | Agent commission value |
comm_type |
int | No | Commission type: 0 money, 1 pips, 2 percent |
comm_lots |
int | No | Commission calculation mode: 0 per lot, 1 per deal |
comm_agent_type |
int | No | Agent commission type/mode |
comm_tax |
double | No | Commission tax value |
lot_min |
int | No | Minimum trade volume |
lot_max |
int | No | Maximum trade volume |
lot_step |
int | No | Trade volume step |
spread_diff |
int | No | Spread difference/additional spread |
confirmation |
int | No | Dealer confirmation required flag |
ie_deviation |
int | No | Max Instant Execution price deviation |
ie_quick_mode |
int | No | Instant Execution quick mode flag |
trade_rights |
int | No | Trade restrictions bitmask: 0 none, 1 close-by denied, 2 multiple close-by denied |
autocloseout_mode |
int | No | Auto close-out mode: 0 none, 1 hihi, 2 lolo, 3 hilo, 4 lohi, 5 FIFO, 6 LIFO, 7 intraday FIFO |
freemargin_mode |
int | No | Free margin control mode |
secmargins Items¶
Each item updates one GroupRecordMargin entry. symbol is required; all
other fields are optional and default to 0 when omitted.
| Field | Type | Required | Description |
|---|---|---|---|
symbol |
string | Yes | Symbol name |
swap_enable |
int | No | Enable custom swaps for this symbol |
swap_long |
double | No | Long-position swap value |
swap_short |
double | No | Short-position swap value |
margin_divider |
double | No | Margin divider |
spread_enable |
int | No | Enable custom spread for this symbol |
spread |
int | No | Custom spread value |
spread_balance |
int | No | Spread balance value |
Request Example¶
{
"group": "standard",
"brand": "ion4",
"account_mode": 1,
"public_opening": 0,
"currency": "USD",
"enable": 1,
"margin_call": 50,
"margin_mode": 0,
"margin_type": 0,
"margin_stopout": 30,
"default_leverage": 200,
"default_deposit": 1000.0,
"allow_sl_tp_slippage": 0,
"secgroups": [
{
"sec_index": 1,
"show": 1,
"trade": 1,
"execution": 0,
"comm_base": 0.0,
"comm_agent": 0.0,
"comm_type": 0,
"comm_lots": 0,
"comm_agent_type": 0,
"comm_tax": 0.0,
"lot_min": 100,
"lot_max": 100000,
"lot_step": 100,
"spread_diff": 0,
"confirmation": 0,
"ie_deviation": 5,
"ie_quick_mode": 0,
"trade_rights": 0,
"autocloseout_mode": 0,
"freemargin_mode": 0
}
],
"secmargins": [
{
"symbol": "EURUSD",
"swap_enable": 1,
"swap_long": -2.0,
"swap_short": 1.5,
"margin_divider": 1.0,
"spread_enable": 1,
"spread": 12,
"spread_balance": 0
}
]
}
Implementation Notes¶
secgroupsandsecmarginsare full replacement-style arrays for the submitted group payload. Omitted nested optional fields are written as default0values.- The current handler accepts only the fields listed above. Reserved fields from
GroupRecordSecandGroupRecordMarginare not accepted throughUpdateGroup. comm_agentis parsed by the current handler twice (double, thenint); clients should send integer-compatible values until backend parsing is normalized.
Response Parameters¶
| Name | Type | Description |
|---|---|---|
| data | string | Returns "OK" on success |
Response Example¶
{
"data": "OK"
}
Validation Errors¶
If validation fails, the method returns HTTP 400-style error payload:
{
"error": "INVALID_DATA",
"message": "each secmargin must contain string symbol"
}
If business validation fails in the backend, the method returns FormatErrorCode(ret) and FormatError(ret) from Core::UpdateGroup(...).