Skip to content
Test Details

Simulate Margin Call Calculation

Launch a Margin Call stress-test calculation with the given assumptions, assessing the Margin Call risk of a client or portfolio under a defined market shock.

Request parameters

  • Required: simulate_cal_type (calculation dimension), cal_type (calculation type), is_filter (whether to apply exemption rules), remark (custom data title).
  • Optional: task_id (batch number), market, stock_group_id, counter_id, price_limit (price change), index_price_limit_info (index-level drop settings).
  • See the field descriptions for the format, value range, and business meaning of each field.

Business notes

simulate_cal_type and cal_type set the calculation dimension and basis; price_limit and index_price_limit_info define the price-shock assumptions; is_filter controls whether exemption rules apply. The calculation runs as an asynchronous task, with results retrieved through the corresponding pre-calculation list/detail queries.

Risk warning

This operation triggers a risk-control stress-test calculation task and generates result data. Confirm that the assumption parameters are reasonable before calling.

Result

On success, the stress-test task is submitted; subsequent state and returned data follow the 200 response definition.

POSThttps://b-api.lbkrs.com/v1/risk_monitoring/simulate_margin_call_cal_v3

Authorization

AuthorizationstringheaderRequired

Send the Broker ACCESS_TOKEN as Authorization: Bearer <token>.

Request body application/json

simulate_cal_typeintegerrequired

Simulate Cal Type. Determines which of task_id, stock_group_id, market, counter_id and index_price_limit_info takes effect.

Allowed values: 0 By batch number, 1 By stock group, 2 By market, 3 By single stock, 4 By index level

Values
0
TaskId
1
StockGroup
2
Market
3
Stock
4
IndexLimit
task_idstring

Task ID. Used only when simulate_cal_type=0.

marketstring

Market. Used only when simulate_cal_type=2, e.g. HK/US.

stock_group_idinteger

Stock Group ID. Used only when simulate_cal_type=1.

counter_idstring

Counter ID. Used only when simulate_cal_type=3. Format is {type}/{market}/{code}, for example, stock ST/HK/700 or ST/US/AAPL, and option OP/US/AAPL270319C320000.

price_limitstring

Price Limit. The assumed price-change percentage, e.g. -10 means a 10% drop.

index_price_limit_infoobject

Index Price Limit Info. Used only when simulate_cal_type=4; the sub-fields tier1_price_limit/tier2_price_limit/other_price_limit correspond to the assumed drops for index level 1 / level 2 / other levels respectively.

cal_typeintegerrequired

Calculation Type.

Allowed values: 0 Full calculation, 1 Margin call calculation, 2 Non-frozen fund surplus calculation

Values
0
Full calculation
1
Margin call calculation
2
Non-frozen fund surplus calculation
is_filterbooleanrequired

Is Filter. Boolean flag for is filter. this field is required.

Boolean values:

  • true - The condition applies
  • false - The condition does not apply
remarkstringrequired

Remark. This field is required.

Responses

HTTP 200The request was processed successfully. data contains task_id.
Standard response envelopecodemessagedata
dataobjectdata structure
task_idstring

Task ID. The batch number generated by this stress-test calculation.

HTTP 400Bad request. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 401The user is not authenticated, or the login session has expired.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 403The current account is not authorized to use this feature. Grant the required permission to the account in User Permission.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

HTTP 408The request timed out. Check the business error code in code and the error details in message.
Standard response envelopecodemessagedata
dataobjectdata structure

No nested fields

Whale Docs