Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# self.get_asset_potential_total

strategies.strategy.Strategy.get_asset_potential_total(self, asset)

  Get the potential total for the asset (orders + positions).

  Parameters:

    asset (Asset) – Asset object who’s potential total is sought.

  Returns:

    The potential total for the asset. Decimals are automatically returned as floats if less than 4 decimal points

  Return type:

    int, float or Decimal

  Example

      >>> # Get the potential total for the TLT asset
      >>> total = self.get_asset_potential_total("TLT")
      >>> self.log_message(total)

      >>> # Show the potential total for an asset
      >>> asset = Asset("TLT")
      >>> total = self.get_asset_potential_total(asset)
      >>> self.log_message(total)

      >>> # Show the potential total for an asset
      >>> asset = Asset("ES", asset_type="future", expiration_date="2020-01-01")
      >>> total = self.get_asset_potential_total(asset)