USDollarAmount#

tradingstrategy.types.USDollarAmount class.

class USDollarAmount[source]#

Bases: TradingStrategyType, float

Express USD monetary amount.

Used in exchange rates, volumes and prices in candle data. Normally you should not use float for pricing, but because we are already losing a lot of accuraty in float conversion and our price data is not for exact transactions, but for modelling, this is ok.

__init__()#

Methods

__init__()

as_integer_ratio()

Return integer ratio.

conjugate()

Return self, the complex conjugate of any float.

fromhex()

Create a floating-point number from a hexadecimal string.

hex()

Return a hexadecimal representation of a floating-point number.

is_integer()

Return True if the float is an integer.

Attributes

imag

the imaginary part of a complex number

real

the real part of a complex number