Lean  $LEAN_TAG$
QuantConnect.Interfaces.IAlgorithm Interface Reference

Interface for QuantConnect algorithm implementations. All algorithms must implement these basic members to allow interaction with the Lean Backtesting Engine. More...

Inheritance diagram for QuantConnect.Interfaces.IAlgorithm:
[legend]

Public Member Functions

void Initialize ()
 Initialise the Algorithm and Prepare Required Data: More...
 
void PostInitialize ()
 Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method More...
 
void OnWarmupFinished ()
 Called when the algorithm has completed initialization and warm up. More...
 
IReadOnlyDictionary< string, string > GetParameters ()
 Gets a read-only dictionary with all current parameters More...
 
string GetParameter (string name, string defaultValue=null)
 Gets the parameter with the specified name. If a parameter with the specified name does not exist, the given default value is returned if any, else null More...
 
int GetParameter (string name, int defaultValue)
 Gets the parameter with the specified name parsed as an integer. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned More...
 
double GetParameter (string name, double defaultValue)
 Gets the parameter with the specified name parsed as a double. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned More...
 
decimal GetParameter (string name, decimal defaultValue)
 Gets the parameter with the specified name parsed as a decimal. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned More...
 
void SetParameters (Dictionary< string, string > parameters)
 Sets the parameters from the dictionary More...
 
bool Shortable (Symbol symbol, decimal shortQuantity, int? updateOrderId=null)
 Determines if the Symbol is shortable at the brokerage More...
 
long ShortableQuantity (Symbol symbol)
 Gets the quantity shortable for the given asset More...
 
void SetBrokerageModel (IBrokerageModel brokerageModel)
 Sets the brokerage model used to resolve transaction models, settlement models, and brokerage specified ordering behaviors. More...
 
void OnData (Slice slice)
 v3.0 Handler for all data types More...
 
void OnFrameworkData (Slice slice)
 Used to send data updates to algorithm framework models More...
 
void OnSplits (Splits splits)
 Event handler to be called when there's been a split event More...
 
void OnDividends (Dividends dividends)
 Event handler to be called when there's been a dividend event More...
 
void OnDelistings (Delistings delistings)
 Event handler to be called when there's been a delistings event More...
 
void OnSymbolChangedEvents (SymbolChangedEvents symbolsChanged)
 Event handler to be called when there's been a symbol changed event More...
 
void OnSecuritiesChanged (SecurityChanges changes)
 Event fired each time that we add/remove securities from the data feed More...
 
void OnFrameworkSecuritiesChanged (SecurityChanges changes)
 Used to send security changes to algorithm framework models More...
 
void OnEndOfTimeStep ()
 Invoked at the end of every time step. This allows the algorithm to process events before advancing to the next time step. More...
 
void Debug (string message)
 Send debug message More...
 
void Log (string message)
 Save entry to the Log More...
 
void Error (string message)
 Send an error message for the algorithm More...
 
void OnMarginCall (List< SubmitOrderRequest > requests)
 Margin call event handler. This method is called right before the margin call orders are placed in the market. More...
 
void OnMarginCallWarning ()
 Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue More...
 
void OnEndOfDay ()
 Call this method at the end of each day of data. More...
 
void OnEndOfDay (Symbol symbol)
 Call this method at the end of each day of data. More...
 
void OnEndOfAlgorithm ()
 Call this event at the end of the algorithm running. More...
 
void OnOrderEvent (OrderEvent newEvent)
 EXPERTS ONLY:: [-!-Async Code-!-] New order event handler: on order status changes (filled, partially filled, cancelled etc). More...
 
bool? OnCommand (dynamic data)
 Generic untyped command call handler More...
 
OrderTicket SubmitOrderRequest (SubmitOrderRequest request)
 Will submit an order request to the algorithm More...
 
void OnAssignmentOrderEvent (OrderEvent assignmentEvent)
 Option assignment event handler. On an option assignment event for short legs the resulting information is passed to this method. More...
 
void OnBrokerageMessage (BrokerageMessageEvent messageEvent)
 Brokerage message event handler. This method is called for all types of brokerage messages. More...
 
void OnBrokerageDisconnect ()
 Brokerage disconnected event handler. This method is called when the brokerage connection is lost. More...
 
void OnBrokerageReconnect ()
 Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection. More...
 
void SetDateTime (DateTime time)
 Set the DateTime Frontier: This is the master time and is More...
 
void SetStartDate (DateTime start)
 Set the start date for the backtest More...
 
void SetEndDate (DateTime end)
 Set the end date for a backtest. More...
 
void SetAlgorithmId (string algorithmId)
 Set the algorithm Id for this backtest or live run. This can be used to identify the order and equity records. More...
 
void SetLocked ()
 Set the algorithm as initialized and locked. No more cash or security changes. More...
 
bool GetLocked ()
 Gets whether or not this algorithm has been locked and fully initialized More...
 
void AddChart (Chart chart)
 Add a Chart object to algorithm collection More...
 
IEnumerable< ChartGetChartUpdates (bool clearChartData=false)
 Get the chart updates since the last request: More...
 
Security AddSecurity (SecurityType securityType, string symbol, Resolution? resolution, string market, bool fillForward, decimal leverage, bool extendedMarketHours, DataMappingMode? dataMappingMode=null, DataNormalizationMode? dataNormalizationMode=null)
 Set a required SecurityType-symbol and resolution for algorithm More...
 
Security AddSecurity (Symbol symbol, Resolution? resolution=null, bool fillForward=true, decimal leverage=Security.NullLeverage, bool extendedMarketHours=false, DataMappingMode? dataMappingMode=null, DataNormalizationMode? dataNormalizationMode=null, int contractDepthOffset=0)
 Set a required SecurityType-symbol and resolution for algorithm More...
 
Future AddFutureContract (Symbol symbol, Resolution? resolution=null, bool fillForward=true, decimal leverage=0m, bool extendedMarketHours=false)
 Creates and adds a new single Future contract to the algorithm More...
 
Option AddOptionContract (Symbol symbol, Resolution? resolution=null, bool fillForward=true, decimal leverage=0m, bool extendedMarketHours=false)
 Creates and adds a new single Option contract to the algorithm More...
 
bool RemoveSecurity (Symbol symbol)
 Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings More...
 
void SetAccountCurrency (string accountCurrency, decimal? startingCash=null)
 Sets the account currency cash symbol this algorithm is to manage, as well as the starting cash in this currency if given More...
 
void SetCash (decimal startingCash)
 Set the starting capital for the strategy More...
 
void SetCash (string symbol, decimal startingCash, decimal conversionRate=0)
 Set the cash for the specified symbol More...
 
List< OrderTicketLiquidate (Symbol symbol=null, bool asynchronous=false, string tag="Liquidated", IOrderProperties orderProperties=null)
 Liquidate your portfolio holdings More...
 
void SetLiveMode (bool live)
 Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode. More...
 
void SetAlgorithmMode (AlgorithmMode algorithmMode)
 Sets the algorithm running mode More...
 
void SetDeploymentTarget (DeploymentTarget deploymentTarget)
 Sets the algorithm deployment target More...
 
void SetFinishedWarmingUp ()
 Sets IsWarmingUp to false to indicate this algorithm has finished its warm up More...
 
void SetMaximumOrders (int max)
 Set the maximum number of orders the algorithm is allowed to process. More...
 
void SetBrokerageMessageHandler (IBrokerageMessageHandler handler)
 Sets the implementation used to handle messages from the brokerage. The default implementation will forward messages to debug or error and when a BrokerageMessageType.Error occurs, the algorithm is stopped. More...
 
void SetHistoryProvider (IHistoryProvider historyProvider)
 Set the historical data provider More...
 
BaseData GetLastKnownPrice (Security security)
 Get the last known price using the history provider. Useful for seeding securities with the correct price More...
 
void SetRunTimeError (Exception exception)
 Set the runtime error More...
 
void SetStatus (AlgorithmStatus status)
 Set the state of a live deployment More...
 
void SetAvailableDataTypes (Dictionary< SecurityType, List< TickType >> availableDataTypes)
 Set the available TickType supported by each SecurityType in SecurityManager More...
 
void SetOptionChainProvider (IOptionChainProvider optionChainProvider)
 Sets the option chain provider, used to get the list of option contracts for an underlying symbol More...
 
void SetFutureChainProvider (IFutureChainProvider futureChainProvider)
 Sets the future chain provider, used to get the list of future contracts for an underlying symbol More...
 
void SetCurrentSlice (Slice slice)
 Sets the current slice More...
 
void SetApi (IApi api)
 Provide the API for the algorithm. More...
 
void SetObjectStore (IObjectStore objectStore)
 Sets the object store More...
 
Symbol Symbol (string ticker)
 Converts the string 'ticker' symbol into a full Symbol object This requires that the string 'ticker' has been added to the algorithm More...
 
string Ticker (Symbol symbol)
 For the given symbol will resolve the ticker it used at the current algorithm date More...
 
void SetStatisticsService (IStatisticsService statisticsService)
 Sets the statistics service instance to be used by the algorithm More...
 
void SetName (string name)
 Sets name to the currently running backtest More...
 
void AddTag (string tag)
 Adds a tag to the algorithm More...
 
void SetTags (HashSet< string > tags)
 Sets the tags for the algorithm More...
 
CommandResultPacket RunCommand (CallbackCommand command)
 Run a callback command instance More...
 

Properties

ITimeKeeper TimeKeeper [get]
 Gets the time keeper instance More...
 
SubscriptionManager SubscriptionManager [get]
 Data subscription manager controls the information and subscriptions the algorithms recieves. Subscription configurations can be added through the Subscription Manager. More...
 
int ProjectId [get, set]
 The project id associated with this algorithm if any More...
 
SecurityManager Securities [get]
 Security object collection class stores an array of objects representing representing each security/asset we have a subscription for. More...
 
UniverseManager UniverseManager [get]
 Gets the collection of universes for the algorithm More...
 
SecurityPortfolioManager Portfolio [get]
 Security portfolio management class provides wrapper and helper methods for the Security.Holdings class such as IsLong, IsShort, TotalProfit More...
 
SecurityTransactionManager Transactions [get]
 Security transaction manager class controls the store and processing of orders. More...
 
IBrokerageModel BrokerageModel [get]
 Gets the brokerage model used to emulate a real brokerage More...
 
BrokerageName BrokerageName [get]
 Gets the brokerage name. More...
 
IRiskFreeInterestRateModel RiskFreeInterestRateModel [get]
 Gets the risk free interest rate model used to get the interest rates More...
 
IBrokerageMessageHandler BrokerageMessageHandler [get, set]
 Gets the brokerage message handler used to decide what to do with each message sent from the brokerage More...
 
NotificationManager Notify [get]
 Notification manager for storing and processing live event messages More...
 
ScheduleManager Schedule [get]
 Gets schedule manager for adding/removing scheduled events More...
 
IHistoryProvider HistoryProvider [get, set]
 Gets or sets the history provider for the algorithm More...
 
AlgorithmStatus Status [get, set]
 Gets or sets the current status of the algorithm More...
 
bool IsWarmingUp [get]
 Gets whether or not this algorithm is still warming up More...
 
string Name [get, set]
 Public name for the algorithm. More...
 
HashSet< string > Tags [get, set]
 A list of tags associated with the algorithm or the backtest, useful for categorization More...
 
DateTime Time [get]
 Current date/time in the algorithm's local time zone More...
 
DateTimeZone TimeZone [get]
 Gets the time zone of the algorithm More...
 
DateTime UtcTime [get]
 Current date/time in UTC. More...
 
DateTime StartDate [get]
 Algorithm start date for backtesting, set by the SetStartDate methods. More...
 
DateTime EndDate [get]
 Get Requested Backtest End Date More...
 
string AlgorithmId [get]
 AlgorithmId for the backtest More...
 
bool LiveMode [get]
 Algorithm is running on a live server. More...
 
AlgorithmMode AlgorithmMode [get]
 Algorithm running mode. More...
 
DeploymentTarget DeploymentTarget [get]
 Deployment target, either local or cloud. More...
 
UniverseSettings UniverseSettings [get]
 Gets the subscription settings to be used when adding securities via universe selection More...
 
ConcurrentQueue< string > DebugMessages [get]
 Debug messages from the strategy: More...
 
ConcurrentQueue< string > ErrorMessages [get]
 Error messages from the strategy: More...
 
ConcurrentQueue< string > LogMessages [get]
 Log messages from the strategy: More...
 
Exception RunTimeError [get, set]
 Gets the run time error from the algorithm, or null if none was encountered. More...
 
ConcurrentDictionary< string, string > RuntimeStatistics [get]
 Customizable dynamic statistics displayed during live trading: More...
 
StatisticsResults Statistics [get]
 The current algorithm statistics for the running algorithm. More...
 
IBenchmark Benchmark [get]
 Gets the function used to define the benchmark. This function will return the value of the benchmark at a requested date/time More...
 
ITradeBuilder TradeBuilder [get]
 Gets the Trade Builder to generate trades from executions More...
 
IAlgorithmSettings Settings [get]
 Gets the user settings for the algorithm More...
 
IOptionChainProvider OptionChainProvider [get]
 Gets the option chain provider, used to get the list of option contracts for an underlying symbol More...
 
IFutureChainProvider FutureChainProvider [get]
 Gets the future chain provider, used to get the list of future contracts for an underlying symbol More...
 
InsightManager Insights [get]
 Gets the insight manager More...
 
ObjectStore ObjectStore [get]
 Gets the object store, used for persistence More...
 
Slice CurrentSlice [get]
 Returns the current Slice object More...
 
- Properties inherited from QuantConnect.Interfaces.ISecurityInitializerProvider
ISecurityInitializer SecurityInitializer [get]
 Gets an instance that is to be used to initialize newly created securities. More...
 
- Properties inherited from QuantConnect.Interfaces.IAccountCurrencyProvider
string AccountCurrency [get]
 Gets the account currency More...
 

Events

AlgorithmEvent< GeneratedInsightsCollectionInsightsGenerated
 Event fired when an algorithm generates a insight More...
 
AlgorithmEvent< string > NameUpdated
 Event fired algorithm's name is changed More...
 
AlgorithmEvent< HashSet< string > > TagsUpdated
 Event fired when the tag collection is updated More...
 

Detailed Description

Interface for QuantConnect algorithm implementations. All algorithms must implement these basic members to allow interaction with the Lean Backtesting Engine.

Definition at line 51 of file IAlgorithm.cs.

Member Function Documentation

◆ Initialize()

void QuantConnect.Interfaces.IAlgorithm.Initialize ( )

Initialise the Algorithm and Prepare Required Data:

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ PostInitialize()

void QuantConnect.Interfaces.IAlgorithm.PostInitialize ( )

Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnWarmupFinished()

void QuantConnect.Interfaces.IAlgorithm.OnWarmupFinished ( )

Called when the algorithm has completed initialization and warm up.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetParameters()

IReadOnlyDictionary<string, string> QuantConnect.Interfaces.IAlgorithm.GetParameters ( )

Gets a read-only dictionary with all current parameters

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ GetParameter() [1/4]

string QuantConnect.Interfaces.IAlgorithm.GetParameter ( string  name,
string  defaultValue = null 
)

Gets the parameter with the specified name. If a parameter with the specified name does not exist, the given default value is returned if any, else null

Parameters
nameThe name of the parameter to get
defaultValueThe default value to return
Returns
The value of the specified parameter, or defaultValue if not found or null if there's no default value

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetParameter() [2/4]

int QuantConnect.Interfaces.IAlgorithm.GetParameter ( string  name,
int  defaultValue 
)

Gets the parameter with the specified name parsed as an integer. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned

Parameters
nameThe name of the parameter to get
defaultValueThe default value to return
Returns
The value of the specified parameter, or defaultValue if not found or null if there's no default value

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetParameter() [3/4]

double QuantConnect.Interfaces.IAlgorithm.GetParameter ( string  name,
double  defaultValue 
)

Gets the parameter with the specified name parsed as a double. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned

Parameters
nameThe name of the parameter to get
defaultValueThe default value to return
Returns
The value of the specified parameter, or defaultValue if not found or null if there's no default value

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetParameter() [4/4]

decimal QuantConnect.Interfaces.IAlgorithm.GetParameter ( string  name,
decimal  defaultValue 
)

Gets the parameter with the specified name parsed as a decimal. If a parameter with the specified name does not exist, or the conversion is not possible, the given default value is returned

Parameters
nameThe name of the parameter to get
defaultValueThe default value to return
Returns
The value of the specified parameter, or defaultValue if not found or null if there's no default value

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetParameters()

void QuantConnect.Interfaces.IAlgorithm.SetParameters ( Dictionary< string, string >  parameters)

Sets the parameters from the dictionary

Parameters
parametersDictionary containing the parameter names to values

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ Shortable()

bool QuantConnect.Interfaces.IAlgorithm.Shortable ( Symbol  symbol,
decimal  shortQuantity,
int?  updateOrderId = null 
)

Determines if the Symbol is shortable at the brokerage

Parameters
symbolSymbol to check if shortable
shortQuantityOrder's quantity to check if it is currently shortable, taking into account current holdings and open orders
updateOrderIdOptionally the id of the order being updated. When updating an order we want to ignore it's submitted short quantity and use the new provided quantity to determine if we can perform the update
Returns
True if the symbol can be shorted by the requested quantity

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ ShortableQuantity()

long QuantConnect.Interfaces.IAlgorithm.ShortableQuantity ( Symbol  symbol)

Gets the quantity shortable for the given asset

Returns
Quantity shortable for the given asset. Zero if not shortable, or a number greater than zero if shortable.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetBrokerageModel()

void QuantConnect.Interfaces.IAlgorithm.SetBrokerageModel ( IBrokerageModel  brokerageModel)

Sets the brokerage model used to resolve transaction models, settlement models, and brokerage specified ordering behaviors.

Parameters
brokerageModelThe brokerage model used to emulate the real brokerage

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnData()

void QuantConnect.Interfaces.IAlgorithm.OnData ( Slice  slice)

v3.0 Handler for all data types

Parameters
sliceThe current slice of data

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnFrameworkData()

void QuantConnect.Interfaces.IAlgorithm.OnFrameworkData ( Slice  slice)

Used to send data updates to algorithm framework models

Parameters
sliceThe current data slice

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnSplits()

void QuantConnect.Interfaces.IAlgorithm.OnSplits ( Splits  splits)

Event handler to be called when there's been a split event

Parameters
splitsThe current time slice splits

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnDividends()

void QuantConnect.Interfaces.IAlgorithm.OnDividends ( Dividends  dividends)

Event handler to be called when there's been a dividend event

Parameters
dividendsThe current time slice dividends

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnDelistings()

void QuantConnect.Interfaces.IAlgorithm.OnDelistings ( Delistings  delistings)

Event handler to be called when there's been a delistings event

Parameters
delistingsThe current time slice delistings

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnSymbolChangedEvents()

void QuantConnect.Interfaces.IAlgorithm.OnSymbolChangedEvents ( SymbolChangedEvents  symbolsChanged)

Event handler to be called when there's been a symbol changed event

Parameters
symbolsChangedThe current time slice symbol changed events

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnSecuritiesChanged()

void QuantConnect.Interfaces.IAlgorithm.OnSecuritiesChanged ( SecurityChanges  changes)

Event fired each time that we add/remove securities from the data feed

Parameters
changesSecurity additions/removals for this time step

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnFrameworkSecuritiesChanged()

void QuantConnect.Interfaces.IAlgorithm.OnFrameworkSecuritiesChanged ( SecurityChanges  changes)

Used to send security changes to algorithm framework models

Parameters
changesSecurity additions/removals for this time step

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnEndOfTimeStep()

void QuantConnect.Interfaces.IAlgorithm.OnEndOfTimeStep ( )

Invoked at the end of every time step. This allows the algorithm to process events before advancing to the next time step.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ Debug()

void QuantConnect.Interfaces.IAlgorithm.Debug ( string  message)

Send debug message

Parameters
message

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ Log()

void QuantConnect.Interfaces.IAlgorithm.Log ( string  message)

Save entry to the Log

Parameters
messageString message

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ Error()

void QuantConnect.Interfaces.IAlgorithm.Error ( string  message)

Send an error message for the algorithm

Parameters
messageString message

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ OnMarginCall()

void QuantConnect.Interfaces.IAlgorithm.OnMarginCall ( List< SubmitOrderRequest requests)

Margin call event handler. This method is called right before the margin call orders are placed in the market.

Parameters
requestsThe orders to be executed to bring this algorithm within margin limits

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnMarginCallWarning()

void QuantConnect.Interfaces.IAlgorithm.OnMarginCallWarning ( )

Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnEndOfDay() [1/2]

void QuantConnect.Interfaces.IAlgorithm.OnEndOfDay ( )

Call this method at the end of each day of data.

Deprecated because different assets have different market close times, and because Python does not support two methods with the same name

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ OnEndOfDay() [2/2]

void QuantConnect.Interfaces.IAlgorithm.OnEndOfDay ( Symbol  symbol)

Call this method at the end of each day of data.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnEndOfAlgorithm()

void QuantConnect.Interfaces.IAlgorithm.OnEndOfAlgorithm ( )

Call this event at the end of the algorithm running.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnOrderEvent()

void QuantConnect.Interfaces.IAlgorithm.OnOrderEvent ( OrderEvent  newEvent)

EXPERTS ONLY:: [-!-Async Code-!-] New order event handler: on order status changes (filled, partially filled, cancelled etc).

Parameters
newEventEvent information

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnCommand()

bool? QuantConnect.Interfaces.IAlgorithm.OnCommand ( dynamic  data)

Generic untyped command call handler

Parameters
dataThe associated data
Returns
True if success, false otherwise. Returning null will disable command feedback

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SubmitOrderRequest()

OrderTicket QuantConnect.Interfaces.IAlgorithm.SubmitOrderRequest ( SubmitOrderRequest  request)

Will submit an order request to the algorithm

Parameters
requestThe request to submit

Will run order prechecks, which include making sure the algorithm is not warming up, security is added and has data among others

Returns
The order ticket

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ OnAssignmentOrderEvent()

void QuantConnect.Interfaces.IAlgorithm.OnAssignmentOrderEvent ( OrderEvent  assignmentEvent)

Option assignment event handler. On an option assignment event for short legs the resulting information is passed to this method.

Parameters
assignmentEventOption exercise event details containing details of the assignment

This method can be called asynchronously and so should only be used by seasoned C# experts. Ensure you use proper locks on thread-unsafe objects

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnBrokerageMessage()

void QuantConnect.Interfaces.IAlgorithm.OnBrokerageMessage ( BrokerageMessageEvent  messageEvent)

Brokerage message event handler. This method is called for all types of brokerage messages.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnBrokerageDisconnect()

void QuantConnect.Interfaces.IAlgorithm.OnBrokerageDisconnect ( )

Brokerage disconnected event handler. This method is called when the brokerage connection is lost.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ OnBrokerageReconnect()

void QuantConnect.Interfaces.IAlgorithm.OnBrokerageReconnect ( )

Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetDateTime()

void QuantConnect.Interfaces.IAlgorithm.SetDateTime ( DateTime  time)

Set the DateTime Frontier: This is the master time and is

Parameters
time

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetStartDate()

void QuantConnect.Interfaces.IAlgorithm.SetStartDate ( DateTime  start)

Set the start date for the backtest

Parameters
startDatetime Start date for backtest

Must be less than end date and within data available

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetEndDate()

void QuantConnect.Interfaces.IAlgorithm.SetEndDate ( DateTime  end)

Set the end date for a backtest.

Parameters
endDatetime value for end date

Must be greater than the start date

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetAlgorithmId()

void QuantConnect.Interfaces.IAlgorithm.SetAlgorithmId ( string  algorithmId)

Set the algorithm Id for this backtest or live run. This can be used to identify the order and equity records.

Parameters
algorithmIdunique 32 character identifier for backtest or live server

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetLocked()

void QuantConnect.Interfaces.IAlgorithm.SetLocked ( )

Set the algorithm as initialized and locked. No more cash or security changes.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetLocked()

bool QuantConnect.Interfaces.IAlgorithm.GetLocked ( )

Gets whether or not this algorithm has been locked and fully initialized

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ AddChart()

void QuantConnect.Interfaces.IAlgorithm.AddChart ( Chart  chart)

Add a Chart object to algorithm collection

Parameters
chartChart object to add to collection.

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetChartUpdates()

IEnumerable<Chart> QuantConnect.Interfaces.IAlgorithm.GetChartUpdates ( bool  clearChartData = false)

Get the chart updates since the last request:

Parameters
clearChartData
Returns
List of Chart Updates

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ AddSecurity() [1/2]

Security QuantConnect.Interfaces.IAlgorithm.AddSecurity ( SecurityType  securityType,
string  symbol,
Resolution resolution,
string  market,
bool  fillForward,
decimal  leverage,
bool  extendedMarketHours,
DataMappingMode dataMappingMode = null,
DataNormalizationMode dataNormalizationMode = null 
)

Set a required SecurityType-symbol and resolution for algorithm

Parameters
securityTypeSecurityType Enum: Equity, Commodity, FOREX or Future
symbolSymbol Representation of the MarketType, e.g. AAPL
resolutionResolution of the MarketType required: MarketData, Second or Minute
marketThe market the requested security belongs to, such as 'usa' or 'fxcm'
fillForwardIf true, returns the last available data even if none in that timeslice.
leverageleverage for this security
extendedMarketHoursExtendedMarketHours send in data from 4am - 8pm, not used for FOREX
dataMappingModeThe contract mapping mode to use for the security
dataNormalizationModeThe price scaling mode to use for the security

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ AddSecurity() [2/2]

Security QuantConnect.Interfaces.IAlgorithm.AddSecurity ( Symbol  symbol,
Resolution resolution = null,
bool  fillForward = true,
decimal  leverage = Security.NullLeverage,
bool  extendedMarketHours = false,
DataMappingMode dataMappingMode = null,
DataNormalizationMode dataNormalizationMode = null,
int  contractDepthOffset = 0 
)

Set a required SecurityType-symbol and resolution for algorithm

Parameters
symbolThe security Symbol
resolutionResolution of the MarketType required: MarketData, Second or Minute
fillForwardIf true, returns the last available data even if none in that timeslice.
leverageleverage for this security
extendedMarketHoursUse extended market hours data
dataMappingModeThe contract mapping mode to use for the security
dataNormalizationModeThe price scaling mode to use for the security
contractDepthOffsetThe continuous contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract
Returns
The new Security that was added to the algorithm

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ AddFutureContract()

Future QuantConnect.Interfaces.IAlgorithm.AddFutureContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillForward = true,
decimal  leverage = 0m,
bool  extendedMarketHours = false 
)

Creates and adds a new single Future contract to the algorithm

Parameters
symbolThe futures contract symbol
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
fillForwardIf true, returns the last available data even if none in that timeslice. Default is

true

Parameters
leverageThe requested leverage for this equity. Default is set by SecurityInitializer
extendedMarketHoursShow the after market data as well
Returns
The new Future security

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ AddOptionContract()

Option QuantConnect.Interfaces.IAlgorithm.AddOptionContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillForward = true,
decimal  leverage = 0m,
bool  extendedMarketHours = false 
)

Creates and adds a new single Option contract to the algorithm

Parameters
symbolThe option contract symbol
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
fillForwardIf true, returns the last available data even if none in that timeslice. Default is

true

Parameters
leverageThe requested leverage for this equity. Default is set by SecurityInitializer
extendedMarketHoursShow the after market data as well
Returns
The new Option security

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ RemoveSecurity()

bool QuantConnect.Interfaces.IAlgorithm.RemoveSecurity ( Symbol  symbol)

Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings

Parameters
symbolThe symbol of the security to be removed

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetAccountCurrency()

void QuantConnect.Interfaces.IAlgorithm.SetAccountCurrency ( string  accountCurrency,
decimal?  startingCash = null 
)

Sets the account currency cash symbol this algorithm is to manage, as well as the starting cash in this currency if given

Has to be called during Initialize before calling SetCash(decimal) or adding any Security

Parameters
accountCurrencyThe account currency cash symbol to set
startingCashThe account currency starting cash to set

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetCash() [1/2]

void QuantConnect.Interfaces.IAlgorithm.SetCash ( decimal  startingCash)

Set the starting capital for the strategy

Parameters
startingCashdecimal starting capital, default $100,000

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetCash() [2/2]

void QuantConnect.Interfaces.IAlgorithm.SetCash ( string  symbol,
decimal  startingCash,
decimal  conversionRate = 0 
)

Set the cash for the specified symbol

Parameters
symbolThe cash symbol to set
startingCashDecimal cash value of portfolio
conversionRateThe current conversion rate for the

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ Liquidate()

List<OrderTicket> QuantConnect.Interfaces.IAlgorithm.Liquidate ( Symbol  symbol = null,
bool  asynchronous = false,
string  tag = "Liquidated",
IOrderProperties  orderProperties = null 
)

Liquidate your portfolio holdings

Parameters
symbolSpecific asset to liquidate, defaults to all.
asynchronousFlag to indicate if the symbols should be liquidated asynchronously
tagCustom tag to know who is calling this
orderPropertiesOrder properties to use

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetLiveMode()

void QuantConnect.Interfaces.IAlgorithm.SetLiveMode ( bool  live)

Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode.

Parameters
liveBool live mode flag

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetAlgorithmMode()

void QuantConnect.Interfaces.IAlgorithm.SetAlgorithmMode ( AlgorithmMode  algorithmMode)

Sets the algorithm running mode

Parameters
algorithmModeAlgorithm mode

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetDeploymentTarget()

void QuantConnect.Interfaces.IAlgorithm.SetDeploymentTarget ( DeploymentTarget  deploymentTarget)

Sets the algorithm deployment target

Parameters
deploymentTargetDeployment target

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetFinishedWarmingUp()

void QuantConnect.Interfaces.IAlgorithm.SetFinishedWarmingUp ( )

Sets IsWarmingUp to false to indicate this algorithm has finished its warm up

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetMaximumOrders()

void QuantConnect.Interfaces.IAlgorithm.SetMaximumOrders ( int  max)

Set the maximum number of orders the algorithm is allowed to process.

Parameters
maxMaximum order count int

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetBrokerageMessageHandler()

void QuantConnect.Interfaces.IAlgorithm.SetBrokerageMessageHandler ( IBrokerageMessageHandler  handler)

Sets the implementation used to handle messages from the brokerage. The default implementation will forward messages to debug or error and when a BrokerageMessageType.Error occurs, the algorithm is stopped.

Parameters
handlerThe message handler to use

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetHistoryProvider()

void QuantConnect.Interfaces.IAlgorithm.SetHistoryProvider ( IHistoryProvider  historyProvider)

Set the historical data provider

Parameters
historyProviderHistorical data provider

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ GetLastKnownPrice()

BaseData QuantConnect.Interfaces.IAlgorithm.GetLastKnownPrice ( Security  security)

Get the last known price using the history provider. Useful for seeding securities with the correct price

Parameters
securitySecurity object for which to retrieve historical data
Returns
A single BaseData object with the last known price

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetRunTimeError()

void QuantConnect.Interfaces.IAlgorithm.SetRunTimeError ( Exception  exception)

Set the runtime error

Parameters
exceptionRepresents error that occur during execution

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetStatus()

void QuantConnect.Interfaces.IAlgorithm.SetStatus ( AlgorithmStatus  status)

Set the state of a live deployment

Parameters
statusLive deployment status

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetAvailableDataTypes()

void QuantConnect.Interfaces.IAlgorithm.SetAvailableDataTypes ( Dictionary< SecurityType, List< TickType >>  availableDataTypes)

Set the available TickType supported by each SecurityType in SecurityManager

Parameters
availableDataTypes>The different TickType each Security supports

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetOptionChainProvider()

void QuantConnect.Interfaces.IAlgorithm.SetOptionChainProvider ( IOptionChainProvider  optionChainProvider)

Sets the option chain provider, used to get the list of option contracts for an underlying symbol

Parameters
optionChainProviderThe option chain provider

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetFutureChainProvider()

void QuantConnect.Interfaces.IAlgorithm.SetFutureChainProvider ( IFutureChainProvider  futureChainProvider)

Sets the future chain provider, used to get the list of future contracts for an underlying symbol

Parameters
futureChainProviderThe future chain provider

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetCurrentSlice()

void QuantConnect.Interfaces.IAlgorithm.SetCurrentSlice ( Slice  slice)

Sets the current slice

Parameters
sliceThe Slice object

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetApi()

void QuantConnect.Interfaces.IAlgorithm.SetApi ( IApi  api)

Provide the API for the algorithm.

Parameters
apiInitiated API

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetObjectStore()

void QuantConnect.Interfaces.IAlgorithm.SetObjectStore ( IObjectStore  objectStore)

Sets the object store

Parameters
objectStoreThe object store

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ Symbol()

Symbol QuantConnect.Interfaces.IAlgorithm.Symbol ( string  ticker)

Converts the string 'ticker' symbol into a full Symbol object This requires that the string 'ticker' has been added to the algorithm

Parameters
tickerThe ticker symbol. This should be the ticker symbol as it was added to the algorithm
Returns
The symbol object mapped to the specified ticker

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ Ticker()

string QuantConnect.Interfaces.IAlgorithm.Ticker ( Symbol  symbol)

For the given symbol will resolve the ticker it used at the current algorithm date

Parameters
symbolThe symbol to get the ticker for
Returns
The mapped ticker for a symbol

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetStatisticsService()

void QuantConnect.Interfaces.IAlgorithm.SetStatisticsService ( IStatisticsService  statisticsService)

Sets the statistics service instance to be used by the algorithm

Parameters
statisticsServiceThe statistics service instance

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

◆ SetName()

void QuantConnect.Interfaces.IAlgorithm.SetName ( string  name)

Sets name to the currently running backtest

Parameters
nameThe name for the backtest

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ AddTag()

void QuantConnect.Interfaces.IAlgorithm.AddTag ( string  tag)

Adds a tag to the algorithm

Parameters
tagThe tag to add

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ SetTags()

void QuantConnect.Interfaces.IAlgorithm.SetTags ( HashSet< string >  tags)

Sets the tags for the algorithm

Parameters
tagsThe tags

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

◆ RunCommand()

CommandResultPacket QuantConnect.Interfaces.IAlgorithm.RunCommand ( CallbackCommand  command)

Run a callback command instance

Parameters
commandThe callback command instance
Returns
The command result

Implemented in QuantConnect.AlgorithmFactory.Python.Wrappers.AlgorithmPythonWrapper.

Here is the caller graph for this function:

Property Documentation

◆ TimeKeeper

ITimeKeeper QuantConnect.Interfaces.IAlgorithm.TimeKeeper
get

Gets the time keeper instance

Definition at line 62 of file IAlgorithm.cs.

◆ SubscriptionManager

SubscriptionManager QuantConnect.Interfaces.IAlgorithm.SubscriptionManager
get

Data subscription manager controls the information and subscriptions the algorithms recieves. Subscription configurations can be added through the Subscription Manager.

Definition at line 71 of file IAlgorithm.cs.

◆ ProjectId

int QuantConnect.Interfaces.IAlgorithm.ProjectId
getset

The project id associated with this algorithm if any

Definition at line 79 of file IAlgorithm.cs.

◆ Securities

SecurityManager QuantConnect.Interfaces.IAlgorithm.Securities
get

Security object collection class stores an array of objects representing representing each security/asset we have a subscription for.

It is an IDictionary implementation and can be indexed by symbol

Definition at line 90 of file IAlgorithm.cs.

◆ UniverseManager

UniverseManager QuantConnect.Interfaces.IAlgorithm.UniverseManager
get

Gets the collection of universes for the algorithm

Definition at line 98 of file IAlgorithm.cs.

◆ Portfolio

SecurityPortfolioManager QuantConnect.Interfaces.IAlgorithm.Portfolio
get

Security portfolio management class provides wrapper and helper methods for the Security.Holdings class such as IsLong, IsShort, TotalProfit

Portfolio is a wrapper and helper class encapsulating the Securities[].Holdings objects

Definition at line 108 of file IAlgorithm.cs.

◆ Transactions

SecurityTransactionManager QuantConnect.Interfaces.IAlgorithm.Transactions
get

Security transaction manager class controls the store and processing of orders.

The orders and their associated events are accessible here. When a new OrderEvent is recieved the algorithm portfolio is updated.

Definition at line 117 of file IAlgorithm.cs.

◆ BrokerageModel

IBrokerageModel QuantConnect.Interfaces.IAlgorithm.BrokerageModel
get

Gets the brokerage model used to emulate a real brokerage

Definition at line 125 of file IAlgorithm.cs.

◆ BrokerageName

BrokerageName QuantConnect.Interfaces.IAlgorithm.BrokerageName
get

Gets the brokerage name.

Definition at line 133 of file IAlgorithm.cs.

◆ RiskFreeInterestRateModel

IRiskFreeInterestRateModel QuantConnect.Interfaces.IAlgorithm.RiskFreeInterestRateModel
get

Gets the risk free interest rate model used to get the interest rates

Definition at line 141 of file IAlgorithm.cs.

◆ BrokerageMessageHandler

IBrokerageMessageHandler QuantConnect.Interfaces.IAlgorithm.BrokerageMessageHandler
getset

Gets the brokerage message handler used to decide what to do with each message sent from the brokerage

Definition at line 150 of file IAlgorithm.cs.

◆ Notify

NotificationManager QuantConnect.Interfaces.IAlgorithm.Notify
get

Notification manager for storing and processing live event messages

Definition at line 159 of file IAlgorithm.cs.

◆ Schedule

ScheduleManager QuantConnect.Interfaces.IAlgorithm.Schedule
get

Gets schedule manager for adding/removing scheduled events

Definition at line 167 of file IAlgorithm.cs.

◆ HistoryProvider

IHistoryProvider QuantConnect.Interfaces.IAlgorithm.HistoryProvider
getset

Gets or sets the history provider for the algorithm

Definition at line 175 of file IAlgorithm.cs.

◆ Status

AlgorithmStatus QuantConnect.Interfaces.IAlgorithm.Status
getset

Gets or sets the current status of the algorithm

Definition at line 184 of file IAlgorithm.cs.

◆ IsWarmingUp

bool QuantConnect.Interfaces.IAlgorithm.IsWarmingUp
get

Gets whether or not this algorithm is still warming up

Definition at line 193 of file IAlgorithm.cs.

◆ Name

string QuantConnect.Interfaces.IAlgorithm.Name
getset

Public name for the algorithm.

Definition at line 201 of file IAlgorithm.cs.

◆ Tags

HashSet<string> QuantConnect.Interfaces.IAlgorithm.Tags
getset

A list of tags associated with the algorithm or the backtest, useful for categorization

Definition at line 210 of file IAlgorithm.cs.

◆ Time

DateTime QuantConnect.Interfaces.IAlgorithm.Time
get

Current date/time in the algorithm's local time zone

Definition at line 229 of file IAlgorithm.cs.

◆ TimeZone

DateTimeZone QuantConnect.Interfaces.IAlgorithm.TimeZone
get

Gets the time zone of the algorithm

Definition at line 237 of file IAlgorithm.cs.

◆ UtcTime

DateTime QuantConnect.Interfaces.IAlgorithm.UtcTime
get

Current date/time in UTC.

Definition at line 245 of file IAlgorithm.cs.

◆ StartDate

DateTime QuantConnect.Interfaces.IAlgorithm.StartDate
get

Algorithm start date for backtesting, set by the SetStartDate methods.

Definition at line 253 of file IAlgorithm.cs.

◆ EndDate

DateTime QuantConnect.Interfaces.IAlgorithm.EndDate
get

Get Requested Backtest End Date

Definition at line 261 of file IAlgorithm.cs.

◆ AlgorithmId

string QuantConnect.Interfaces.IAlgorithm.AlgorithmId
get

AlgorithmId for the backtest

Definition at line 269 of file IAlgorithm.cs.

◆ LiveMode

bool QuantConnect.Interfaces.IAlgorithm.LiveMode
get

Algorithm is running on a live server.

Definition at line 277 of file IAlgorithm.cs.

◆ AlgorithmMode

AlgorithmMode QuantConnect.Interfaces.IAlgorithm.AlgorithmMode
get

Algorithm running mode.

Definition at line 285 of file IAlgorithm.cs.

◆ DeploymentTarget

DeploymentTarget QuantConnect.Interfaces.IAlgorithm.DeploymentTarget
get

Deployment target, either local or cloud.

Definition at line 293 of file IAlgorithm.cs.

◆ UniverseSettings

UniverseSettings QuantConnect.Interfaces.IAlgorithm.UniverseSettings
get

Gets the subscription settings to be used when adding securities via universe selection

Definition at line 301 of file IAlgorithm.cs.

◆ DebugMessages

ConcurrentQueue<string> QuantConnect.Interfaces.IAlgorithm.DebugMessages
get

Debug messages from the strategy:

Definition at line 309 of file IAlgorithm.cs.

◆ ErrorMessages

ConcurrentQueue<string> QuantConnect.Interfaces.IAlgorithm.ErrorMessages
get

Error messages from the strategy:

Definition at line 317 of file IAlgorithm.cs.

◆ LogMessages

ConcurrentQueue<string> QuantConnect.Interfaces.IAlgorithm.LogMessages
get

Log messages from the strategy:

Definition at line 325 of file IAlgorithm.cs.

◆ RunTimeError

Exception QuantConnect.Interfaces.IAlgorithm.RunTimeError
getset

Gets the run time error from the algorithm, or null if none was encountered.

Definition at line 333 of file IAlgorithm.cs.

◆ RuntimeStatistics

ConcurrentDictionary<string, string> QuantConnect.Interfaces.IAlgorithm.RuntimeStatistics
get

Customizable dynamic statistics displayed during live trading:

Definition at line 342 of file IAlgorithm.cs.

◆ Statistics

StatisticsResults QuantConnect.Interfaces.IAlgorithm.Statistics
get

The current algorithm statistics for the running algorithm.

Definition at line 350 of file IAlgorithm.cs.

◆ Benchmark

IBenchmark QuantConnect.Interfaces.IAlgorithm.Benchmark
get

Gets the function used to define the benchmark. This function will return the value of the benchmark at a requested date/time

Definition at line 359 of file IAlgorithm.cs.

◆ TradeBuilder

ITradeBuilder QuantConnect.Interfaces.IAlgorithm.TradeBuilder
get

Gets the Trade Builder to generate trades from executions

Definition at line 367 of file IAlgorithm.cs.

◆ Settings

IAlgorithmSettings QuantConnect.Interfaces.IAlgorithm.Settings
get

Gets the user settings for the algorithm

Definition at line 375 of file IAlgorithm.cs.

◆ OptionChainProvider

IOptionChainProvider QuantConnect.Interfaces.IAlgorithm.OptionChainProvider
get

Gets the option chain provider, used to get the list of option contracts for an underlying symbol

Definition at line 383 of file IAlgorithm.cs.

◆ FutureChainProvider

IFutureChainProvider QuantConnect.Interfaces.IAlgorithm.FutureChainProvider
get

Gets the future chain provider, used to get the list of future contracts for an underlying symbol

Definition at line 391 of file IAlgorithm.cs.

◆ Insights

InsightManager QuantConnect.Interfaces.IAlgorithm.Insights
get

Gets the insight manager

Definition at line 399 of file IAlgorithm.cs.

◆ ObjectStore

ObjectStore QuantConnect.Interfaces.IAlgorithm.ObjectStore
get

Gets the object store, used for persistence

Definition at line 406 of file IAlgorithm.cs.

◆ CurrentSlice

Slice QuantConnect.Interfaces.IAlgorithm.CurrentSlice
get

Returns the current Slice object

Definition at line 411 of file IAlgorithm.cs.

Event Documentation

◆ InsightsGenerated

AlgorithmEvent<GeneratedInsightsCollection> QuantConnect.Interfaces.IAlgorithm.InsightsGenerated

Event fired when an algorithm generates a insight

Definition at line 56 of file IAlgorithm.cs.

◆ NameUpdated

AlgorithmEvent<string> QuantConnect.Interfaces.IAlgorithm.NameUpdated

Event fired algorithm's name is changed

Definition at line 218 of file IAlgorithm.cs.

◆ TagsUpdated

AlgorithmEvent<HashSet<string> > QuantConnect.Interfaces.IAlgorithm.TagsUpdated

Event fired when the tag collection is updated

Definition at line 223 of file IAlgorithm.cs.


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