Skip to content

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
company string Yes Company name
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
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

Required field:

Field Type Required
sec_index int Yes

Supported optional fields: - show - trade - execution - comm_base - comm_agent - comm_type - comm_lots - comm_agent_type - comm_tax - lot_min - lot_max - lot_step - spread_diff - confirmation - ie_deviation - ie_quick_mode - trade_rights - autocloseout_mode - freemargin_mode

secmargins Items

Required field:

Field Type Required
symbol string Yes

Supported optional fields: - swap_long - swap_short - margin_divider - spread_enable - spread - spread_balance

Request Example

{
  "group": "standard",
  "company": "MyBroker",
  "currency": "USD",
  "enable": 1,
  "margin_call": 50,
  "margin_mode": 0,
  "margin_type": 0,
  "margin_stopout": 30,
  "default_leverage": 200,
  "default_deposit": 1000.0,
  "secgroups": [
    {
      "sec_index": 1,
      "show": 1,
      "trade": 1,
      "execution": 0
    }
  ],
  "secmargins": [
    {
      "symbol": "EURUSD",
      "swap_long": -2.0,
      "swap_short": 1.5,
      "margin_divider": 1.0
    }
  ]
}

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(...).