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

Provides an implementation of ICurrencyConversion to find and use multi-leg currency conversions More...

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

Public Member Functions

void Update ()
 Signals an updates to the internal conversion rate based on the latest data. It will set the conversion rate as potentially outdated so it gets re-calculated. More...
 

Static Public Member Functions

static SecurityCurrencyConversion LinearSearch (string sourceCurrency, string destinationCurrency, IList< Security > existingSecurities, IEnumerable< Symbol > potentialSymbols, Func< Symbol, Security > makeNewSecurity)
 Finds a conversion between two currencies by looking through all available 1 and 2-leg options More...
 

Public Attributes

IEnumerable< SecurityConversionRateSecurities => _steps.Select(step => step.RateSecurity)
 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 to find and use multi-leg currency conversions

Definition at line 28 of file SecurityCurrencyConversion.cs.

Member Function Documentation

◆ Update()

void QuantConnect.Securities.CurrencyConversion.SecurityCurrencyConversion.Update ( )

Signals an updates to the internal conversion rate based on the latest data. It will set the conversion rate as potentially outdated so it gets re-calculated.

Implements QuantConnect.Securities.CurrencyConversion.ICurrencyConversion.

Definition at line 158 of file SecurityCurrencyConversion.cs.

◆ LinearSearch()

static SecurityCurrencyConversion QuantConnect.Securities.CurrencyConversion.SecurityCurrencyConversion.LinearSearch ( string  sourceCurrency,
string  destinationCurrency,
IList< Security existingSecurities,
IEnumerable< Symbol potentialSymbols,
Func< Symbol, Security makeNewSecurity 
)
static

Finds a conversion between two currencies by looking through all available 1 and 2-leg options

Parameters
sourceCurrencyThe currency to convert from
destinationCurrencyThe currency to convert to
existingSecuritiesThe securities which are already added to the algorithm
potentialSymbolsThe symbols to consider, may overlap with existingSecurities
makeNewSecurityThe function to call when a symbol becomes part of the conversion, must return the security that will provide price data about the symbol
Returns
A new SecurityCurrencyConversion instance representing the conversion from sourceCurrency to destinationCurrency
Exceptions
ArgumentExceptionThrown when no conversion from sourceCurrency to destinationCurrency can be found

Definition at line 173 of file SecurityCurrencyConversion.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.SecurityCurrencyConversion.ConversionRateSecurities => _steps.Select(step => step.RateSecurity)

The securities which the conversion rate is based on

Definition at line 137 of file SecurityCurrencyConversion.cs.

Property Documentation

◆ SourceCurrency

string QuantConnect.Securities.CurrencyConversion.SecurityCurrencyConversion.SourceCurrency
get

The currency this conversion converts from

Definition at line 70 of file SecurityCurrencyConversion.cs.

◆ DestinationCurrency

string QuantConnect.Securities.CurrencyConversion.SecurityCurrencyConversion.DestinationCurrency
get

The currency this conversion converts to

Definition at line 75 of file SecurityCurrencyConversion.cs.

◆ ConversionRate

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

The current conversion rate

Definition at line 81 of file SecurityCurrencyConversion.cs.

Event Documentation

◆ ConversionRateUpdated

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

Event fired when the conversion rate is updated

Definition at line 65 of file SecurityCurrencyConversion.cs.


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