Represents a holding of a currency in cash.
More...
Represents a holding of a currency in cash.
Definition at line 33 of file Cash.cs.
◆ Cash()
QuantConnect.Securities.Cash.Cash |
( |
string |
symbol, |
|
|
decimal |
amount, |
|
|
decimal |
conversionRate |
|
) |
| |
Initializes a new instance of the Cash class
- Parameters
-
symbol | The symbol used to represent this cash |
amount | The amount of this currency held |
conversionRate | The initial conversion rate of this currency into the CashBook.AccountCurrency |
Definition at line 149 of file Cash.cs.
◆ Update()
void QuantConnect.Securities.Cash.Update |
( |
| ) |
|
Marks this cash object's conversion rate as being potentially outdated
Definition at line 164 of file Cash.cs.
◆ AddAmount()
decimal QuantConnect.Securities.Cash.AddAmount |
( |
decimal |
amount | ) |
|
Adds the specified amount of currency to this Cash instance and returns the new total. This operation is thread-safe
- Parameters
-
amount | The amount of currency to be added |
- Returns
- The amount of currency directly after the addition
Definition at line 175 of file Cash.cs.
◆ SetAmount()
void QuantConnect.Securities.Cash.SetAmount |
( |
decimal |
amount | ) |
|
Sets the Quantity to the specified amount
- Parameters
-
amount | The amount to set the quantity to |
Definition at line 189 of file Cash.cs.
◆ EnsureCurrencyDataFeed()
Ensures that we have a data feed to convert this currency into the base currency. This will add a SubscriptionDataConfig and create a Security at the lowest resolution if one is not found.
- Parameters
-
securities | The security manager |
subscriptions | The subscription manager used for searching and adding subscriptions |
marketMap | The market map that decides which market the new security should be in |
changes | Will be used to consume SecurityChanges.AddedSecurities |
securityService | Will be used to create required new Security |
accountCurrency | The account currency |
defaultResolution | The default resolution to use for the internal subscriptions |
- Returns
- Returns the added SubscriptionDataConfig, otherwise null
Definition at line 221 of file Cash.cs.
◆ ToString() [1/2]
override string QuantConnect.Securities.Cash.ToString |
( |
| ) |
|
Returns a string that represents the current Cash.
- Returns
- A string that represents the current Cash.
Definition at line 342 of file Cash.cs.
◆ ToString() [2/2]
string QuantConnect.Securities.Cash.ToString |
( |
string |
accountCurrency | ) |
|
Returns a string that represents the current Cash.
- Returns
- A string that represents the current Cash.
Definition at line 351 of file Cash.cs.
◆ SecuritySymbols
IEnumerable<Symbol> QuantConnect.Securities.Cash.SecuritySymbols |
Initial value:
Gets the symbols of the securities required to provide conversion rates. If this cash represents the account currency, then an empty enumerable is returned.
Definition at line 54 of file Cash.cs.
◆ ValueInAccountCurrency
Gets the value of this cash in the account currency
Definition at line 141 of file Cash.cs.
◆ CurrencyConversion
Gets the object that calculates the conversion rate to account currency
Definition at line 64 of file Cash.cs.
◆ Symbol
string QuantConnect.Securities.Cash.Symbol |
|
get |
Gets the symbol used to represent this cash
Definition at line 103 of file Cash.cs.
◆ Amount
decimal QuantConnect.Securities.Cash.Amount |
|
get |
Gets or sets the amount of cash held
Definition at line 109 of file Cash.cs.
◆ ConversionRate
decimal QuantConnect.Securities.Cash.ConversionRate |
|
getset |
Gets the conversion rate into account currency
Definition at line 116 of file Cash.cs.
◆ CurrencySymbol
string QuantConnect.Securities.Cash.CurrencySymbol |
|
get |
The symbol of the currency, such as $
Definition at line 136 of file Cash.cs.
◆ Updated
EventHandler QuantConnect.Securities.Cash.Updated |
◆ CurrencyConversionUpdated
EventHandler QuantConnect.Securities.Cash.CurrencyConversionUpdated |
The documentation for this class was generated from the following file: