Skip to content
Test Details

Simulate Margin Call Calculation

Simulates Margin Call Calculation.

Request parameters

  • Required: simulate_cal_type (Simulate Cal Type), cal_type (Calculation Type), is_filter (Is Filter), remark (Remark)
  • Optional: task_id (Task ID), market (Market), stock_group_id (Stock Group ID), counter_id (Counter ID), price_limit (Price Limit), index_price_limit_info (Index Price Limit Info)
  • See each field for its format, allowed values, and business meaning.

Result

On success, the endpoint completes the operation. See the 200 response schema for returned data and subsequent state information.

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

Production: https://b-api.lbkrs.com · Test: https://b-api.longbridge.xyz

Authorization

AuthorizationstringheaderRequired

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

Permission

No dedicated permission key. Any authenticated Broker ACCESS_TOKEN with access to this scope can call it.

Request body application/json

simulate_cal_typeintegerrequired

Simulate Cal Type. SimulateCalType determines which dependent field applies: 0 by batch number, 1 by stock group, 2 by market, 3 by stock, or 4 by index level. The dependent fields are task_id, stock_group_id, market, counter_id, and index_price_limit_info.

0 · TaskId1 · StockGroup2 · Market3 · Stock4 · 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.

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_typearray<string>required

Calculation Type. A string-array enum: 0=full calculation, 1=margin call calculation, 2=non-frozen funds surplus calculation; multiple values allowed.

0 · Full Calculation2 · Non-Frozen Fund Surplus Calculation1 · Margin Call 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