Clients¶
Both clients are context managers and expose the same resource groups (see
Resource groups). Use StoneXClient for synchronous code and
AsyncStoneXClient for asyncio.
stonepy.StoneXClient
¶
StoneXClient(config: ClientConfig)
Synchronous StoneX CIAPI v2 client.
Use as a context manager or call close() when finished. Resource properties
lazily construct typed API resource groups.
Source code in src/stonepy/client.py
call_context
property
¶
Return shared call state for explicitly constructed resources.
This property cannot be reassigned; its context contains mutable state. Use it only while this client is open.
client_preference
property
¶
client_preference: ClientPreferenceResource
Return the client_preference resource group.
client_application
property
¶
client_application: ClientapplicationResource
Return the client_application resource group.
clientapplication
property
¶
clientapplication: ClientapplicationResource
Deprecated alias of client_application.
clientpreference
property
¶
clientpreference: ClientpreferenceResource
Return the clientpreference resource group.
order_including_closed
property
¶
order_including_closed: OrderIncludingClosedResource
Return the order_including_closed resource group.
trading_advisor
property
¶
trading_advisor: TradingadvisorResource
Return the trading_advisor resource group.
tradingadvisor
property
¶
tradingadvisor: TradingadvisorResource
Deprecated alias of trading_advisor.
stonepy.AsyncStoneXClient
¶
AsyncStoneXClient(config: ClientConfig)
Asynchronous StoneX CIAPI v2 client.
Use with async with or call aclose() when finished. Resource properties
mirror the synchronous client and expose awaitable methods.
Source code in src/stonepy/client.py
call_context
property
¶
Return shared call state for explicitly constructed resources.
This property cannot be reassigned; its context contains mutable state. Use it only while this client is open.
client_preference
property
¶
Return the client_preference resource group.
client_application
property
¶
Return the client_application resource group.
clientapplication
property
¶
Deprecated alias of client_application.
clientpreference
property
¶
Return the clientpreference resource group.
fixed_margin
property
¶
Return the fixed_margin resource group.
order_including_closed
property
¶
Return the order_including_closed resource group.
trading_advisor
property
¶
Return the trading_advisor resource group.
tradingadvisor
property
¶
Deprecated alias of trading_advisor.
user_account
property
¶
Return the user_account resource group.