UpdateGroup¶
Requires set_accounts. The current group and target brand must match the manager scope loaded from the cached staff manager record.
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 |
| margin_call_recovery_buffer | double | No | Buffer above margin_call required to leave Margin Call. Percentage points for percent margin, account currency for currency margin. Existing value is preserved when omitted |
| margin_stopout_recovery_buffer | double | No | Buffer above margin_stopout required to leave Stop Out. Percentage points for percent margin, account currency for currency margin. Existing value is preserved when omitted |
| margin_recovery_hold_ms | int | No | Continuous recovery hold time in milliseconds (0–600000). Existing value is preserved when omitted |
| 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 |
| bonus_usage_policy | int | No | Bonus policy bitmask 0–7; existing value is preserved when omitted |
| deposit_reversal_policy | int | No | Executed-deposit deletion policy: 0 rejects a reversal that would make balance negative; 1 allows it. Existing value is preserved when omitted |
| use_swap | int | No | Swap enabled flag |
| hedge_prohibited | int | No | Hedge prohibited flag |
| allow_negative_margin_hedge | int | No | Controls opening when current free margin is negative: 1 allows a trade only when projected free margin does not worsen; 0 rejects the trade. Allowed values: 0 or 1; existing value is preserved when omitted |
| 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,
"margin_call_recovery_buffer": 5.0,
"margin_stopout_recovery_buffer": 5.0,
"margin_recovery_hold_ms": 3000,
"default_leverage": 200,
"default_deposit": 1000.0,
"bonus_usage_policy": 7,
"deposit_reversal_policy": 0,
"allow_negative_margin_hedge": 1,
"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¶
- More severe margin-state transitions are immediate. A transition from
MCorSOto a less severe state requires the corresponding recovery threshold to remain satisfied continuously formargin_recovery_hold_ms. - Recovery is checked during full account margin recalculations and is committed on the first recalculation after the hold period. Removing all open exposure returns the account to
OKimmediately. - Omitting any recovery field from
UpdateGrouppreserves its current stored value. - Omitting
allow_negative_margin_hedgepreserves its current stored value. - Omitting
bonus_usage_policypreserves its current stored value. - Omitting
deposit_reversal_policypreserves its current stored value. - With
allow_negative_margin_hedge = 1, an opening or pending activation while current free margin is negative is allowed only when projected free margin does not worsen. With0, it is rejected withRET_TRADE_NO_MONEY. deposit_reversal_policy = 1affects only deletion of an executed deposit that would produce a negative cash balance. It does not bypass normal withdrawal, credit, or bonus checks. After an allowed reversal, the runtime recalculates the full margin state and may trigger Margin Call or Stop Out.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(...).