Portfolio management
List accounts
List all accounts available to the user. This includes FCM accounts, which must be specified when sending orders.
res = await client.list_accounts()
for item in res:
print(item.account.name)
Account permissions
list
Trader is allowed to know about the account but not its balances or positions
reduce_or_close
Trader can send orders only to reduce or close (risk manager)
set_limits
Trader allowed to set or change risk limits on the account
trade
Trader allowed to send orders
view
Read-only view of account, including balances and positions
Get account summary
Get an account summary for a specified account.
res = await client.get_account_summary("STONEX:000000/JDoe")
print(res)
# get multiple account summaries
res = await client.get_account_summaries([
"STONEX:000000/JDoe",
"STONEX:000001/JDoe"
])
print(res)
Account summary fields
account
Account ID
timestamp
Snapshot timestamp
equity
Total account equity or net liquidation value
cash_excess
Withdrawable cash
purchasing_power
Total purchasing power of the account
unrealized_pnl
Unrealized P&L
realized_pnl
Realized P&L
yesterday_equity
Yesterday account equity or net liquidation value; not provided on all venues
total_margin
Margin usage including open orders and positions
position_margin
Margin usage including only positions
balances
Map of products/assets to their quantities
positions
See "Account Positions" table
Get account history
Get historical snapshots of account summaries for the specified account.
from datetime import datetime
res = await client.get_account_history(
account="STONEX:000000/JDoe",
from_inclusive=datetime(2025, 1, 1),
to_exclusive=datetime(2025, 1, 2)
)
print(res)
Last updated