get_asset_quantity
Returns the quantity owned of a specified asset.
Syntax
Fields
Description
symbol(str)
Symbol of asset. Defaults to first symbol in watchlist
include_pending_buy(bool)
If true, include pending buy orders in the quantity. Defaults to false
include_pending_sell(bool)
If true, include pending sell orders in the quantity. Defaults to false
def get_asset_quantity(self, symbol: str, include_pending_buy: bool, include_pending_sell: bool) -> float:
Returns
Returns the quantity of the specified asset as a float. Returns 0 if the asset is not owned.
Raises
- An
Exception
is raised if there is an error retrieving the asset quantity.