The History Order table is to query all of your historical orders, it includes the all orders that have been executed, canceled, or rejected.
https://open.longportapp.com/en/docs/trade/order/history_orders
symbol
is optional, if present, only return the orders of the specified symbol, otherwise return all orders.side
is optional, available values:Buy
,Sell
.market
is optional, available values:HK
,US
.start_at
is optional, to limit the start time of the query, the format is UNIX timestamp in seconds, e.g.:1650410999
.end_at
is optional, to limit the end time of the query, the format is UNIX timestamp in seconds, e.g.:1650410999
.
select
symbol,
order_id,
status,
stock_name,
quantity,
executed_quantity,
price,
executed_price,
submitted_at,
side,
order_type,
last_done,
trigger_price,
msg
from
longport_history_order;
select
symbol,
order_id,
status,
stock_name,
quantity,
executed_quantity,
price,
executed_price,
submitted_at,
side,
order_type,
last_done,
trigger_price,
msg
from
longport_history_order;
If you present the symbol
, only return the orders of the specified symbol.
select
*
from
longport_history_order
where
symbol = 'TSLA.US';
select
*
from
longport_history_order
where
symbol = 'TSLA.US';