Skip to content
Fee Estimates

Estimate Post-Trade Average Cost

Calculates the average purchase cost and the diluted cost after the trade from the current position quantity and cost and the order price and quantity. Call it after Estimate Trading Fees succeeds, and show the result as the estimated cost on the order page. To include trading fees in the cost, pass fee_amount. When you call this endpoint through WhaleCore requestService(), set requiresTradeToken to true.

GEThttps://api.lbkrs.com/v4/portfolio/stock/get_trading_stock_avgcost

Parameters

counter_idstringqueryRequired

Security ID (counter_id), for example ST/US/AAPL or ST/HK/700

holding_quantitystringqueryRequired

Current position quantity. Use quantity from Get Position and Cash for Order Entry.

sidestringqueryRequired

Order direction

BUYSELL

avg_coststringqueryRequired

Current average purchase cost. Use average_cost; pass 0 when there is no position.

diluted_avg_coststringqueryRequired

Current diluted cost. Use diluted_avg_cost; pass 0 when there is no position.

pricestringqueryRequired

Order unit price, the same as price passed to Estimate Trading Fees

quantitystringqueryRequired

Order quantity in shares

fee_amountstringquery

Trading fees to include in the cost: the sum of commission, third, and platform from Estimate Trading Fees. When omitted, the cost excludes fees.

Responses

HTTP 200The request succeeded. The response body contains the result of the “Estimate Post-Trade Average Cost” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
avg_coststring

Average purchase cost after the trade

diluted_avg_coststring

Diluted cost after the trade

Whale Docs