Lean
$LEAN_TAG$
|
Provides an implementation of ICurrencyConversion with a fixed conversion rate More...
Public Member Functions | |
ConstantCurrencyConversion (string sourceCurrency, string destinationCurrency, decimal conversionRate=1m) | |
Initializes a new instance of the ConstantCurrencyConversion class. More... | |
void | Update () |
Marks the conversion rate as potentially outdated, needing an update based on the latest data More... | |
Static Public Member Functions | |
static ConstantCurrencyConversion | Identity (string sourceCurrency, string destinationCurrency=null) |
Creates a new identity conversion, where the conversion rate is set to 1 and the source and destination currencies might the same More... | |
static ConstantCurrencyConversion | Null (string sourceCurrency, string destinationCurrency) |
Returns an instance of ConstantCurrencyConversion that represents a null conversion More... | |
Public Attributes | |
IEnumerable< Security > | ConversionRateSecurities => Enumerable.Empty<Security>() |
The securities which the conversion rate is based on More... | |
Properties | |
string | SourceCurrency [get] |
The currency this conversion converts from More... | |
string | DestinationCurrency [get] |
The currency this conversion converts to More... | |
decimal? | ConversionRate [get, set] |
The current conversion rate More... | |
Properties inherited from QuantConnect.Securities.CurrencyConversion.ICurrencyConversion | |
string | SourceCurrency [get] |
The currency this conversion converts from More... | |
string | DestinationCurrency [get] |
The currency this conversion converts to More... | |
decimal | ConversionRate [get, set] |
The current conversion rate between SourceCurrency and DestinationCurrency More... | |
IEnumerable< Security > | ConversionRateSecurities [get] |
The securities which the conversion rate is based on More... | |
Events | |
EventHandler< decimal > | ConversionRateUpdated |
Event fired when the conversion rate is updated More... | |
Events inherited from QuantConnect.Securities.CurrencyConversion.ICurrencyConversion | |
EventHandler< decimal > | ConversionRateUpdated |
Event fired when the conversion rate is updated More... | |
Provides an implementation of ICurrencyConversion with a fixed conversion rate
Definition at line 26 of file ConstantCurrencyConversion.cs.
QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConstantCurrencyConversion | ( | string | sourceCurrency, |
string | destinationCurrency, | ||
decimal | conversionRate = 1m |
||
) |
Initializes a new instance of the ConstantCurrencyConversion class.
sourceCurrency | The currency this conversion converts from |
destinationCurrency | The currency this conversion converts to |
conversionRate | The conversion rate between the currencies |
Definition at line 76 of file ConstantCurrencyConversion.cs.
void QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.Update | ( | ) |
Marks the conversion rate as potentially outdated, needing an update based on the latest data
This conversion is not based on securities, so we don't really need an update
Implements QuantConnect.Securities.CurrencyConversion.ICurrencyConversion.
Definition at line 87 of file ConstantCurrencyConversion.cs.
|
static |
Creates a new identity conversion, where the conversion rate is set to 1 and the source and destination currencies might the same
sourceCurrency | The currency this conversion converts from |
destinationCurrency | The currency this conversion converts to. If null, the destination and source currencies are the same |
Definition at line 97 of file ConstantCurrencyConversion.cs.
|
static |
Returns an instance of ConstantCurrencyConversion that represents a null conversion
Definition at line 105 of file ConstantCurrencyConversion.cs.
IEnumerable<Security> QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConversionRateSecurities => Enumerable.Empty<Security>() |
The securities which the conversion rate is based on
Definition at line 68 of file ConstantCurrencyConversion.cs.
|
get |
The currency this conversion converts from
Definition at line 38 of file ConstantCurrencyConversion.cs.
|
get |
The currency this conversion converts to
Definition at line 43 of file ConstantCurrencyConversion.cs.
|
getset |
The current conversion rate
Definition at line 49 of file ConstantCurrencyConversion.cs.
EventHandler<decimal> QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConversionRateUpdated |
Event fired when the conversion rate is updated
Definition at line 33 of file ConstantCurrencyConversion.cs.