Skip to content
Longport Whale
Test Details

Simulate Margin Call Calculation

The "Add Test" button on the Test Details page; enters hypothetical parameters to trigger a stress-test calculation.

POSThttps://b-api.longbridge.xyz/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. enum SimulateCalType { 0=calculate by batch number (TaskId), 1=calculate by stock group (StockGroup), 2=calculate by market (Market), 3=calculate by stock (Stock), 4=calculate by index level (IndexLimit) }; determines which of task_id/stock_group_id/market/counter_id/index_price_limit_info below takes effect.

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.

is_filterbooleanrequired

Is Filter. Whether to apply the exemption rule.

remarkstringrequired

Remark. The remark/title of this test.

Responses

HTTP 200Returns business fields.
Standard response envelopecodemessagedata
dataobjectdata structure
task_idstring

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

Whale Docs