Lean  $LEAN_TAG$
QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion Class Reference

Provides an implementation of ICurrencyConversion with a fixed conversion rate More...

Inheritance diagram for QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion:
[legend]

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< SecurityConversionRateSecurities => 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< SecurityConversionRateSecurities [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...
 

Detailed Description

Provides an implementation of ICurrencyConversion with a fixed conversion rate

Definition at line 26 of file ConstantCurrencyConversion.cs.

Constructor & Destructor Documentation

◆ ConstantCurrencyConversion()

QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConstantCurrencyConversion ( string  sourceCurrency,
string  destinationCurrency,
decimal  conversionRate = 1m 
)

Initializes a new instance of the ConstantCurrencyConversion class.

Parameters
sourceCurrencyThe currency this conversion converts from
destinationCurrencyThe currency this conversion converts to
conversionRateThe conversion rate between the currencies

Definition at line 76 of file ConstantCurrencyConversion.cs.

Here is the caller graph for this function:

Member Function Documentation

◆ Update()

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.

◆ Identity()

static ConstantCurrencyConversion QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.Identity ( string  sourceCurrency,
string  destinationCurrency = null 
)
static

Creates a new identity conversion, where the conversion rate is set to 1 and the source and destination currencies might the same

Parameters
sourceCurrencyThe currency this conversion converts from
destinationCurrencyThe currency this conversion converts to. If null, the destination and source currencies are the same
Returns
The identity currency conversion

Definition at line 97 of file ConstantCurrencyConversion.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Null()

static ConstantCurrencyConversion QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.Null ( string  sourceCurrency,
string  destinationCurrency 
)
static

Returns an instance of ConstantCurrencyConversion that represents a null conversion

Definition at line 105 of file ConstantCurrencyConversion.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ConversionRateSecurities

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.

Property Documentation

◆ SourceCurrency

string QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.SourceCurrency
get

The currency this conversion converts from

Definition at line 38 of file ConstantCurrencyConversion.cs.

◆ DestinationCurrency

string QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.DestinationCurrency
get

The currency this conversion converts to

Definition at line 43 of file ConstantCurrencyConversion.cs.

◆ ConversionRate

decimal? QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConversionRate
getset

The current conversion rate

Definition at line 49 of file ConstantCurrencyConversion.cs.

Event Documentation

◆ ConversionRateUpdated

EventHandler<decimal> QuantConnect.Securities.CurrencyConversion.ConstantCurrencyConversion.ConversionRateUpdated

Event fired when the conversion rate is updated

Definition at line 33 of file ConstantCurrencyConversion.cs.


The documentation for this class was generated from the following file: