CashAmount
QuantConnect.Securities.CashAmount
CashAmount(amount: float, currency: str)
Represents a cash amount which can be converted to account currency using a currency converter
Initializes a new instance of the CashAmount class
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
amount
|
float
|
The amount |
required |
currency
|
str
|
The currency |
required |
amount
amount: float
The amount of cash
currency
currency: str
The currency in which the cash amount is denominated
__eq__
__eq__(rhs: CashAmount) -> bool
Will determine if two CashAmount instances are equal Useful to compare against the default instance
Returns:
| Type | Description |
|---|---|
bool
|
True if currency and amount are equal. |
__ne__
__ne__(rhs: CashAmount) -> bool
Will determine if two CashAmount instances are different Useful to compare against the default instance
Returns:
| Type | Description |
|---|---|
bool
|
True if currency or amount are different. |
equals
equals(obj: Any) -> bool
Used to compare two CashAmount instances. Useful to compare against the default instance
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj
|
Any
|
The other object to compare with |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if currency and amount are equal. |
get_hash_code
get_hash_code() -> int
Get Hash Code for this Object
Returns:
| Type | Description |
|---|---|
int
|
Integer Hash Code. |