Lean
QuantConnect.Algorithm.QCAlgorithm Class Reference

QC Algorithm Base Class - Handle the basic requirements of a trading algorithm, allowing user to focus on event methods. The QCAlgorithm class implements Portfolio, Securities, Transactions and Data Subscription Management. More...

Inheritance diagram for QuantConnect.Algorithm.QCAlgorithm:
[legend]

Public Member Functions

 QCAlgorithm ()
 QCAlgorithm Base Class Constructor - Initialize the underlying QCAlgorithm components. QCAlgorithm manages the transactions, portfolio, charting and security subscriptions for the users algorithms. More...
 
virtual void Initialize ()
 Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized. More...
 
virtual void PostInitialize ()
 Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method More...
 
virtual void OnWarmupFinished ()
 Called when the algorithm has completed initialization and warm up. More...
 
string GetParameter (string name)
 Gets the parameter with the specified name. If a parameter with the specified name does not exist, null is returned More...
 
IReadOnlyDictionary< string, string > GetParameters ()
 Gets a read-only dictionary with all current parameters More...
 
void SetParameters (Dictionary< string, string > parameters)
 Sets the parameters from the dictionary More...
 
void SetAvailableDataTypes (Dictionary< SecurityType, List< TickType >> availableDataTypes)
 Set the available data feeds in the SecurityManager More...
 
void SetSecurityInitializer (ISecurityInitializer securityInitializer)
 Sets the security initializer, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities. More...
 
void SetSecurityInitializer (Action< Security, bool > securityInitializer)
 Sets the security initializer function, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities. More...
 
void SetSecurityInitializer (Action< Security > securityInitializer)
 Sets the security initializer function, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities. 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...
 
virtual void OnData (Slice slice)
 Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event More...
 
virtual void OnSecuritiesChanged (SecurityChanges changes)
 Event fired each time the we add/remove securities from the data feed More...
 
virtual 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...
 
virtual void OnMarginCallWarning ()
 Margin call warning event handler. This method is called when Portfolio.MarginRemaining is under 5% of your Portfolio.TotalPortfolioValue More...
 
virtual void OnEndOfDay ()
 End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets). More...
 
virtual void OnEndOfDay (string symbol)
 End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets). More...
 
virtual void OnEndOfDay (Symbol symbol)
 End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets). More...
 
virtual void OnEndOfAlgorithm ()
 End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs. More...
 
virtual void OnOrderEvent (OrderEvent orderEvent)
 Order fill event handler. On an order fill update the resulting information is passed to this method. More...
 
virtual 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...
 
virtual void OnBrokerageMessage (BrokerageMessageEvent messageEvent)
 Brokerage message event handler. This method is called for all types of brokerage messages. More...
 
virtual void OnBrokerageDisconnect ()
 Brokerage disconnected event handler. This method is called when the brokerage connection is lost. More...
 
virtual void OnBrokerageReconnect ()
 Brokerage reconnected event handler. This method is called when the brokerage connection is restored after a disconnection. More...
 
void SetDateTime (DateTime frontier)
 Update the internal algorithm time frontier. More...
 
void SetTimeZone (string timeZone)
 Sets the time zone of the Time property in the algorithm More...
 
void SetTimeZone (DateTimeZone timeZone)
 Sets the time zone of the Time property in the algorithm More...
 
void SetBrokerageModel (BrokerageName brokerage, AccountType accountType=AccountType.Margin)
 Sets the brokerage to emulate in backtesting or paper trading. This can be used for brokerages that have been implemented in LEAN More...
 
void SetBrokerageModel (IBrokerageModel model)
 Sets the brokerage to emulate in backtesting or paper trading. This can be used to set a custom brokerage model. 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 SetBenchmark (SecurityType securityType, string symbol)
 Sets the benchmark used for computing statistics of the algorithm to the specified symbol More...
 
void SetBenchmark (string ticker)
 Sets the benchmark used for computing statistics of the algorithm to the specified ticker, defaulting to SecurityType.Equity if the ticker doesn't exist in the algorithm More...
 
void SetBenchmark (Symbol symbol)
 Sets the benchmark used for computing statistics of the algorithm to the specified symbol More...
 
void SetBenchmark (Func< DateTime, decimal > benchmark)
 Sets the specified function as the benchmark, this function provides the value of the benchmark at each date/time requested More...
 
void SetAccountCurrency (string accountCurrency)
 Sets the account currency cash symbol this algorithm is to manage. More...
 
void SetCash (double startingCash)
 Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account. More...
 
void SetCash (int startingCash)
 Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account. More...
 
void SetCash (decimal startingCash)
 Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account. More...
 
void SetCash (string symbol, decimal startingCash, decimal conversionRate=0)
 Set the cash for the specified symbol More...
 
void SetStartDate (int year, int month, int day)
 Set the start date for backtest. More...
 
void SetEndDate (int year, int month, int day)
 Set the end date for a backtest run More...
 
void SetAlgorithmId (string algorithmId)
 Set the algorithm id (backtestId or live deployId for the algorithmm). 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 SetLocked ()
 Lock the algorithm initialization to avoid user modifiying cash and data stream subscriptions More...
 
bool GetLocked ()
 Gets whether or not this algorithm has been locked and fully initialized More...
 
void SetLiveMode (bool live)
 Set live mode state of the algorithm run: Public setter for the algorithm property LiveMode. More...
 
void SetTradeBuilder (ITradeBuilder tradeBuilder)
 Set the ITradeBuilder implementation to generate trades from executions and market price updates More...
 
Security AddSecurity (SecurityType securityType, string ticker, Resolution? resolution=null, bool fillDataForward=true, bool extendedMarketHours=false)
 Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine. More...
 
Security AddSecurity (SecurityType securityType, string ticker, Resolution? resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours)
 Add specified data to required list. QC will funnel this data to the handle data routine. More...
 
Security AddSecurity (SecurityType securityType, string ticker, Resolution? resolution, string market, bool fillDataForward, decimal leverage, bool extendedMarketHours)
 Set a required SecurityType-symbol and resolution for algorithm More...
 
Security AddSecurity (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage, bool extendedMarketHours=false)
 Set a required SecurityType-symbol and resolution for algorithm More...
 
Equity AddEquity (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage, bool extendedMarketHours=false)
 Creates and adds a new Equity security to the algorithm More...
 
Option AddOption (string underlying, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new equity Option security to the algorithm More...
 
Option AddOption (Symbol underlying, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new Option security to the algorithm. This method can be used to add options with non-equity asset classes to the algorithm (e.g. Future Options). More...
 
Future AddFuture (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new Future security to the algorithm More...
 
Future AddFutureContract (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new single Future contract to the algorithm More...
 
void AddFutureOption (Symbol symbol, Func< OptionFilterUniverse, OptionFilterUniverse > optionFilter=null)
 Creates and adds a new Future Option contract to the algorithm. More...
 
Option AddFutureOptionContract (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Adds a future option contract to the algorithm. More...
 
Option AddIndexOption (string ticker, Resolution? resolution=null, string market=Market.USA, bool fillDataForward=true)
 Creates and adds index options to the algorithm. More...
 
Option AddIndexOption (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true)
 Creates and adds index options to the algorithm. More...
 
Option AddIndexOptionContract (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true)
 Adds an index option contract to the algorithm. More...
 
Option AddOptionContract (Symbol symbol, Resolution? resolution=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new single Option contract to the algorithm More...
 
Forex AddForex (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new Forex security to the algorithm More...
 
Cfd AddCfd (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new Cfd security to the algorithm More...
 
Index AddIndex (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true)
 Creates and adds a new Index security to the algorithm More...
 
Crypto AddCrypto (string ticker, Resolution? resolution=null, string market=null, bool fillDataForward=true, decimal leverage=Security.NullLeverage)
 Creates and adds a new Crypto security to the algorithm More...
 
bool RemoveOptionContract (Symbol symbol)
 Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings 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...
 
Security AddData< T > (string ticker, Resolution? resolution=null)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)
More...
 
Security AddData< T > (Symbol underlying, Resolution? resolution=null)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)
More...
 
Security AddData< T > (string ticker, Resolution? resolution, bool fillDataForward, decimal leverage=1.0m)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)
More...
 
Security AddData< T > (Symbol underlying, Resolution? resolution, bool fillDataForward, decimal leverage=1.0m)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)
More...
 
Security AddData< T > (string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillDataForward=false, decimal leverage=1.0m)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options.
More...
 
Security AddData< T > (Symbol underlying, Resolution? resolution, DateTimeZone timeZone, bool fillDataForward=false, decimal leverage=1.0m)
 AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options.
More...
 
Security AddData< T > (string ticker, SymbolProperties properties, SecurityExchangeHours exchangeHours, Resolution? resolution=null, bool fillDataForward=false, decimal leverage=1.0m)
 AddData

Template Parameters
Ta new user defined data source including symbol properties and exchange hours, all other vars are not required and will use defaults.
More...
 
void Debug (string message)
 Send a debug message to the web console: More...
 
void Debug (int message)
 Send a debug message to the web console: More...
 
void Debug (double message)
 Send a debug message to the web console: More...
 
void Debug (decimal message)
 Send a debug message to the web console: More...
 
void Log (string message)
 Added another method for logging if user guessed. More...
 
void Log (int message)
 Added another method for logging if user guessed. More...
 
void Log (double message)
 Added another method for logging if user guessed. More...
 
void Log (decimal message)
 Added another method for logging if user guessed. More...
 
void Error (string message)
 Send a string error message to the Console. More...
 
void Error (int message)
 Send a int error message to the Console. More...
 
void Error (double message)
 Send a double error message to the Console. More...
 
void Error (decimal message)
 Send a decimal error message to the Console. More...
 
void Error (Exception error)
 Send a string error message to the Console. More...
 
void Quit (string message="")
 Terminate the algorithm after processing the current event handler. More...
 
void SetQuit (bool quit)
 Set the Quit flag property of the algorithm. 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...
 
void SetHistoryProvider (IHistoryProvider historyProvider)
 Set the historical data provider More...
 
void SetRunTimeError (Exception exception)
 Set the runtime error More...
 
void SetStatus (AlgorithmStatus status)
 Set the state of a live deployment More...
 
string Download (string address)
 Downloads the requested resource as a string. The resource to download is specified as a string containing the URI. More...
 
string Download (string address, IEnumerable< KeyValuePair< string, string >> headers)
 Downloads the requested resource as a string. The resource to download is specified as a string containing the URI. More...
 
string Download (string address, IEnumerable< KeyValuePair< string, string >> headers, string userName, string password)
 Downloads the requested resource as a string. The resource to download is specified as a string containing the URI. More...
 
ScheduledEvent Train (Action trainingCode)
 Schedules the provided training code to execute immediately More...
 
ScheduledEvent Train (IDateRule dateRule, ITimeRule timeRule, Action trainingCode)
 Schedules the training code to run using the specified date and time rules 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...
 
bool Shortable (Symbol symbol)
 Determines if the Symbol is shortable at the brokerage More...
 
bool Shortable (Symbol symbol, decimal shortQuantity)
 Determines if the Symbol is shortable at the brokerage More...
 
long ShortableQuantity (Symbol symbol)
 Gets the quantity shortable for the given asset More...
 
Dictionary< Symbol, long > AllShortableSymbols ()
 Gets all Symbols that are shortable, as well as the quantity shortable for them More...
 
Symbol ISIN (string isin, DateTime? tradingDate=null)
 Converts an ISIN identifier into a Symbol More...
 
Symbol CompositeFIGI (string compositeFigi, DateTime? tradingDate=null)
 Converts a composite FIGI identifier into a Symbol More...
 
Symbol CUSIP (string cusip, DateTime? tradingDate=null)
 Converts a CUSIP identifier into a Symbol More...
 
Symbol SEDOL (string sedol, DateTime? tradingDate=null)
 Converts a SEDOL identifier into a Symbol More...
 
void FrameworkPostInitialize ()
 Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method More...
 
void OnFrameworkData (Slice slice)
 Used to send data updates to algorithm framework models More...
 
void OnFrameworkSecuritiesChanged (SecurityChanges changes)
 Used to send security changes to algorithm framework models More...
 
void SetUniverseSelection (IUniverseSelectionModel universeSelection)
 Sets the universe selection model More...
 
void AddUniverseSelection (IUniverseSelectionModel universeSelection)
 Adds a new universe selection model More...
 
void SetAlpha (IAlphaModel alpha)
 Sets the alpha model More...
 
void AddAlpha (IAlphaModel alpha)
 Adds a new alpha model More...
 
void SetPortfolioConstruction (IPortfolioConstructionModel portfolioConstruction)
 Sets the portfolio construction model More...
 
void SetExecution (IExecutionModel execution)
 Sets the execution model More...
 
void SetRiskManagement (IRiskManagementModel riskManagement)
 Sets the risk management model More...
 
void AddRiskManagement (IRiskManagementModel riskManagement)
 Adds a new risk management model More...
 
void EmitInsights (params Insight[] insights)
 Manually emit insights from an algorithm. This is typically invoked before calls to submit orders in algorithms written against QCAlgorithm that have been ported into the algorithm framework. More...
 
void EmitInsights (Insight insight)
 Manually emit insights from an algorithm. This is typically invoked before calls to submit orders in algorithms written against QCAlgorithm that have been ported into the algorithm framework. More...
 
void SetAlpha (PyObject alpha)
 Sets the alpha model More...
 
void AddAlpha (PyObject alpha)
 Adds a new alpha model More...
 
void SetExecution (PyObject execution)
 Sets the execution model More...
 
void SetPortfolioConstruction (PyObject portfolioConstruction)
 Sets the portfolio construction model More...
 
void SetUniverseSelection (PyObject universeSelection)
 Sets the universe selection model More...
 
void AddUniverseSelection (PyObject universeSelection)
 Adds a new universe selection model More...
 
void SetRiskManagement (PyObject riskManagement)
 Sets the risk management model More...
 
void AddRiskManagement (PyObject riskManagement)
 Adds a new risk management model More...
 
void SetWarmup (TimeSpan timeSpan)
 Sets the warm up period to the specified value More...
 
void SetWarmUp (TimeSpan timeSpan)
 Sets the warm up period to the specified value More...
 
void SetWarmup (TimeSpan timeSpan, Resolution? resolution)
 Sets the warm up period to the specified value More...
 
void SetWarmUp (TimeSpan timeSpan, Resolution? resolution)
 Sets the warm up period to the specified value More...
 
void SetWarmup (int barCount)
 Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. The highest (smallest) resolution in the securities collection will be used. For example, if an algorithm has minute and daily data and 200 bars are requested, that would use 200 minute bars. More...
 
void SetWarmUp (int barCount)
 Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. The highest (smallest) resolution in the securities collection will be used. For example, if an algorithm has minute and daily data and 200 bars are requested, that would use 200 minute bars. More...
 
void SetWarmup (int barCount, Resolution? resolution)
 Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. More...
 
void SetWarmUp (int barCount, Resolution? resolution)
 Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. More...
 
void SetFinishedWarmingUp ()
 Sets IAlgorithm.IsWarmingUp to false to indicate this algorithm has finished its warm up More...
 
IEnumerable< HistoryRequestGetWarmupHistoryRequests ()
 Gets the history requests required for provide warm up data for the algorithm More...
 
IEnumerable< SliceHistory (TimeSpan span, Resolution? resolution=null)
 Get the history for all configured securities over the requested span. This will use the resolution and other subscription settings for each security. The symbols must exist in the Securities collection. More...
 
IEnumerable< SliceHistory (int periods, Resolution? resolution=null)
 Get the history for all configured securities over the requested span. This will use the resolution and other subscription settings for each security. The symbols must exist in the Securities collection. More...
 
IEnumerable< DataDictionary< T > > History< T > (TimeSpan span, Resolution? resolution=null)
 Gets the historical data for all symbols of the requested type over the requested span. The symbol's configured values for resolution and fill forward behavior will be used The symbols must exist in the Securities collection. More...
 
IEnumerable< DataDictionary< T > > History< T > (IEnumerable< Symbol > symbols, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbols over the requested span. The symbols must exist in the Securities collection. More...
 
IEnumerable< DataDictionary< T > > History< T > (IEnumerable< Symbol > symbols, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection. More...
 
IEnumerable< DataDictionary< T > > History< T > (IEnumerable< Symbol > symbols, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection. More...
 
IEnumerable< T > History< T > (Symbol symbol, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection. More...
 
IEnumerable< TradeBarHistory (Symbol symbol, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbol. The exact number of bars will be returned. The symbol must exist in the Securities collection. More...
 
IEnumerable< T > History< T > (Symbol symbol, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbol. The exact number of bars will be returned. The symbol must exist in the Securities collection. More...
 
IEnumerable< T > History< T > (Symbol symbol, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbol between the specified dates. The symbol must exist in the Securities collection. More...
 
IEnumerable< TradeBarHistory (Symbol symbol, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection. More...
 
IEnumerable< TradeBarHistory (Symbol symbol, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection. More...
 
IEnumerable< SliceHistory (IEnumerable< Symbol > symbols, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbols over the requested span. The symbol's configured values for resolution and fill forward behavior will be used The symbols must exist in the Securities collection. More...
 
IEnumerable< SliceHistory (IEnumerable< Symbol > symbols, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection. More...
 
IEnumerable< SliceHistory (IEnumerable< Symbol > symbols, DateTime start, DateTime end, Resolution? resolution=null, bool? fillForward=null, bool? extendedMarket=null)
 Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection. More...
 
IEnumerable< SliceHistory (HistoryRequest request)
 Executes the specified history request More...
 
IEnumerable< SliceHistory (IEnumerable< HistoryRequest > requests)
 Executes the specified history requests More...
 
IEnumerable< BaseDataGetLastKnownPrices (Security security)
 Yields data to warmup a security for all it's subscribed data types More...
 
IEnumerable< BaseDataGetLastKnownPrices (Symbol symbol)
 Yields data to warmup a security for all it's subscribed data types More...
 
BaseData GetLastKnownPrice (Security security)
 Get the last known price using the history provider. Useful for seeding securities with the correct price More...
 
AccelerationBands ABANDS (Symbol symbol, int period, decimal width=4, MovingAverageType movingAverageType=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new Acceleration Bands indicator. More...
 
AccumulationDistribution AD (Symbol symbol, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new AccumulationDistribution indicator. More...
 
AccumulationDistributionOscillator ADOSC (Symbol symbol, int fastPeriod, int slowPeriod, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new AccumulationDistributionOscillator indicator. More...
 
AutoRegressiveIntegratedMovingAverage ARIMA (Symbol symbol, int arOrder, int diffOrder, int maOrder, int period, Resolution? resolution=null)
 Creates a new ARIMA indicator. More...
 
AverageDirectionalIndex ADX (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Average Directional Index indicator. The indicator will be automatically updated on the given resolution. More...
 
AwesomeOscillator AO (Symbol symbol, int slowPeriod, int fastPeriod, MovingAverageType type, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Awesome Oscillator from the specified periods. More...
 
AverageDirectionalMovementIndexRating ADXR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new AverageDirectionalMovementIndexRating indicator. More...
 
ArnaudLegouxMovingAverage ALMA (Symbol symbol, int period, int sigma=6, decimal offset=0.85m, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new ArnaudLegouxMovingAverage indicator. More...
 
AbsolutePriceOscillator APO (Symbol symbol, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new AbsolutePriceOscillator indicator. More...
 
AroonOscillator AROON (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta) More...
 
AroonOscillator AROON (Symbol symbol, int upPeriod, int downPeriod, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta) More...
 
AverageTrueRange ATR (Symbol symbol, int period, MovingAverageType type=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new AverageTrueRange indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
AugenPriceSpike APS (Symbol symbol, int period=3, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates an AugenPriceSpike indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
BollingerBands BB (Symbol symbol, int period, decimal k, MovingAverageType movingAverageType=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation More...
 
BalanceOfPower BOP (Symbol symbol, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Balance Of Power indicator. The indicator will be automatically updated on the given resolution. More...
 
CoppockCurve CC (Symbol symbol, int shortRocPeriod=11, int longRocPeriod=14, int lwmaPeriod=10, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Initializes a new instance of the CoppockCurve indicator More...
 
CommodityChannelIndex CCI (Symbol symbol, int period, MovingAverageType movingAverageType=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new CommodityChannelIndex indicator. The indicator will be automatically updated on the given resolution. More...
 
ChaikinMoneyFlow CMF (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new ChaikinMoneyFlow indicator. More...
 
DeMarkerIndicator DEM (Symbol symbol, int period, MovingAverageType type, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 
DonchianChannel DCH (Symbol symbol, int upperPeriod, int lowerPeriod, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Donchian Channel indicator which will compute the Upper Band and Lower Band. The indicator will be automatically updated on the given resolution. More...
 
DonchianChannel DCH (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Overload shorthand to create a new symmetric Donchian Channel indicator which has the upper and lower channels set to the same period length. More...
 
DoubleExponentialMovingAverage DEMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new DoubleExponentialMovingAverage indicator. More...
 
DetrendedPriceOscillator DPO (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new DetrendedPriceOscillator indicator. More...
 
ExponentialMovingAverage EMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
ExponentialMovingAverage EMA (Symbol symbol, int period, decimal smoothingFactor, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
EaseOfMovementValue EMV (Symbol symbol, int period=1, int scale=10000, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, Func< IBaseData, IBaseDataBar > selector=null, Func< IBaseData, bool > filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, Resolution resolution, Func< IBaseData, IBaseDataBar > selector=null, Func< IBaseData, bool > filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, TimeSpan resolution, Func< IBaseData, IBaseDataBar > selector=null, Func< IBaseData, bool > filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
FisherTransform FISH (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates an FisherTransform indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
FractalAdaptiveMovingAverage FRAMA (Symbol symbol, int period, int longPeriod=198, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates an FractalAdaptiveMovingAverage (FRAMA) indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
HeikinAshi HeikinAshi (Symbol symbol, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new Heikin-Ashi indicator. More...
 
HullMovingAverage HMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new HullMovingAverage indicator. The Hull moving average is a series of nested weighted moving averages, is fast and smooth. More...
 
IchimokuKinkoHyo ICHIMOKU (Symbol symbol, int tenkanPeriod, int kijunPeriod, int senkouAPeriod, int senkouBPeriod, int senkouADelayPeriod, int senkouBDelayPeriod, Resolution? resolution=null)
 Creates a new IchimokuKinkoHyo indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
Identity Identity (Symbol symbol, Func< IBaseData, decimal > selector=null, string fieldName=null)
 Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
Identity Identity (Symbol symbol, Resolution resolution, Func< IBaseData, decimal > selector=null, string fieldName=null)
 Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
Identity Identity (Symbol symbol, TimeSpan resolution, Func< IBaseData, decimal > selector=null, string fieldName=null)
 Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
KaufmanAdaptiveMovingAverage KAMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new KaufmanAdaptiveMovingAverage indicator. More...
 
KaufmanAdaptiveMovingAverage KAMA (Symbol symbol, int period, int fastEmaPeriod, int slowEmaPeriod, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new KaufmanAdaptiveMovingAverage indicator. More...
 
KeltnerChannels KCH (Symbol symbol, int period, decimal k, MovingAverageType movingAverageType=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Keltner Channels indicator. The indicator will be automatically updated on the given resolution. More...
 
LogReturn LOGR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new LogReturn indicator. More...
 
LeastSquaresMovingAverage LSMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates and registers a new Least Squares Moving Average instance. More...
 
LinearWeightedMovingAverage LWMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new LinearWeightedMovingAverage indicator. This indicator will linearly distribute the weights across the periods. More...
 
MovingAverageConvergenceDivergence MACD (Symbol symbol, int fastPeriod, int slowPeriod, int signalPeriod, MovingAverageType type=MovingAverageType.Exponential, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a MACD indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
MeanAbsoluteDeviation MAD (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new MeanAbsoluteDeviation indicator. More...
 
VolumeProfile VP (Symbol symbol, int period=2, decimal valueAreaVolumePercentage=0.70m, decimal priceRangeRoundOff=0.05m, Resolution resolution=Resolution.Daily, Func< IBaseData, TradeBar > selector=null)
 Creates an Market Profile indicator for the symbol with Volume Profile (VOL) mode. The indicator will be automatically updated on the given resolution. More...
 
TimeProfile TP (Symbol symbol, int period=2, decimal valueAreaVolumePercentage=0.70m, decimal priceRangeRoundOff=0.05m, Resolution resolution=Resolution.Daily, Func< IBaseData, TradeBar > selector=null)
 Creates an Market Profile indicator for the symbol with Time Price Opportunity (TPO) mode. The indicator will be automatically updated on the given resolution. More...
 
Maximum MAX (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Maximum indicator to compute the maximum value More...
 
MoneyFlowIndex MFI (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new MoneyFlowIndex indicator. The indicator will be automatically updated on the given resolution. More...
 
MassIndex MASS (Symbol symbol, int emaPeriod=9, int sumPeriod=25, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new Mass Index indicator. The indicator will be automatically updated on the given resolution. More...
 
MidPoint MIDPOINT (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new MidPoint indicator. More...
 
MidPrice MIDPRICE (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new MidPrice indicator. More...
 
Minimum MIN (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Minimum indicator to compute the minimum value More...
 
Momentum MOM (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Momentum indicator. This will compute the absolute n-period change in the security. The indicator will be automatically updated on the given resolution. More...
 
MomersionIndicator MOMERSION (Symbol symbol, int? minPeriod, int fullPeriod, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Momersion indicator. More...
 
MomentumPercent MOMP (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new MomentumPercent indicator. This will compute the n-period percent change in the security. The indicator will be automatically updated on the given resolution. More...
 
NormalizedAverageTrueRange NATR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new NormalizedAverageTrueRange indicator. More...
 
OnBalanceVolume OBV (Symbol symbol, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new On Balance Volume indicator. This will compute the cumulative total volume based on whether the close price being higher or lower than the previous period. The indicator will be automatically updated on the given resolution. More...
 
PivotPointsHighLow PPHL (Symbol symbol, int lengthHigh, int lengthLow, int lastStoredValues=100, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new PivotPointsHighLow indicator More...
 
PercentagePriceOscillator PPO (Symbol symbol, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new PercentagePriceOscillator indicator. More...
 
ParabolicStopAndReverse PSAR (Symbol symbol, decimal afStart=0.02m, decimal afIncrement=0.02m, decimal afMax=0.2m, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Parabolic SAR indicator More...
 
RegressionChannel RC (Symbol symbol, int period, decimal k, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RegressionChannel indicator which will compute the LinearRegression, UpperChannel and LowerChannel lines, the intercept and slope More...
 
RateOfChange ROC (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RateOfChange indicator. This will compute the n-period rate of change in the security. The indicator will be automatically updated on the given resolution. More...
 
RateOfChangePercent ROCP (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RateOfChangePercent indicator. This will compute the n-period percentage rate of change in the security. The indicator will be automatically updated on the given resolution. More...
 
RateOfChangeRatio ROCR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RateOfChangeRatio indicator. More...
 
RelativeStrengthIndex RSI (Symbol symbol, int period, MovingAverageType movingAverageType=MovingAverageType.Wilders, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RelativeStrengthIndex indicator. This will produce an oscillator that ranges from 0 to 100 based on the ratio of average gains to average losses over the specified period. More...
 
RelativeVigorIndex RVI (Symbol symbol, int period, MovingAverageType movingAverageType=MovingAverageType.Simple, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates a new RelativeVigorIndex indicator. More...
 
RelativeDailyVolume RDV (Symbol symbol, int period=2, Resolution resolution=Resolution.Daily, Func< IBaseData, TradeBar > selector=null)
 Creates an RelativeDailyVolume indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
SharpeRatio SR (Symbol symbol, int sharpePeriod, decimal riskFreeRate=0.0m, Resolution ? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new RollingSharpeRatio indicator. More...
 
SimpleMovingAverage SMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates an SimpleMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
SchaffTrendCycle STC (Symbol symbol, int cyclePeriod, int fastPeriod, int slowPeriod, MovingAverageType movingAverageType=MovingAverageType.Exponential, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Schaff Trend Cycle indicator More...
 
StandardDeviation STD (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new StandardDeviation indicator. This will return the population standard deviation of samples over the specified period. More...
 
Stochastic STO (Symbol symbol, int period, int kPeriod, int dPeriod, Resolution? resolution=null)
 Creates a new Stochastic indicator. More...
 
Stochastic STO (Symbol symbol, int period, Resolution? resolution=null)
 Overload short hand to create a new Stochastic indicator; defaulting to the 3 period for dStoch More...
 
Sum SUM (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Sum indicator. More...
 
SwissArmyKnife SWISS (Symbol symbol, int period, double delta, SwissArmyKnifeTool tool, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates Swiss Army Knife transformation for the symbol. The indicator will be automatically updated on the given resolution. More...
 
T3MovingAverage T3 (Symbol symbol, int period, decimal volumeFactor=0.7m, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new T3MovingAverage indicator. More...
 
TripleExponentialMovingAverage TEMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new TripleExponentialMovingAverage indicator. More...
 
TrueRange TR (Symbol symbol, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new TrueRange indicator. More...
 
TriangularMovingAverage TRIMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new TriangularMovingAverage indicator. More...
 
Trix TRIX (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Trix indicator. More...
 
UltimateOscillator ULTOSC (Symbol symbol, int period1, int period2, int period3, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new UltimateOscillator indicator. More...
 
Variance VAR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a new Variance indicator. This will return the population variance of samples over the specified period. More...
 
VolumeWeightedAveragePriceIndicator VWAP (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, TradeBar > selector=null)
 Creates an VolumeWeightedAveragePrice (VWAP) indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
IntradayVwap VWAP (Symbol symbol)
 Creates the canonical VWAP indicator that resets each day. The indicator will be automatically updated on the security's configured resolution. More...
 
WilliamsPercentR WILR (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, IBaseDataBar > selector=null)
 Creates a new Williams R indicator. This will compute the percentage change of the current closing price in relation to the high and low of the past N periods. The indicator will be automatically updated on the given resolution. More...
 
WilderMovingAverage WWMA (Symbol symbol, int period, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates a WilderMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
WilderSwingIndex SI (Symbol symbol, decimal limitMove, Resolution? resolution=Resolution.Daily)
 Creates a Wilder Swing Index (SI) indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
WilderAccumulativeSwingIndex ASI (Symbol symbol, decimal limitMove, Resolution? resolution=Resolution.Daily)
 Creates a Wilder Accumulative Swing Index (ASI) indicator for the symbol. The indicator will be automatically updated on the given resolution. More...
 
ArmsIndex TRIN (IEnumerable< Symbol > symbols, Resolution? resolution=null)
 Creates a new Arms Index indicator More...
 
ArmsIndex TRIN (Symbol[] symbols, Resolution? resolution=null)
 Creates a new Arms Index indicator More...
 
AdvanceDeclineRatio ADR (IEnumerable< Symbol > symbols, Resolution? resolution=null)
 Creates a new Advance/Decline Ratio indicator More...
 
AdvanceDeclineVolumeRatio ADVR (IEnumerable< Symbol > symbols, Resolution? resolution=null)
 Creates a new Advance/Decline Volume Ratio indicator More...
 
string CreateIndicatorName (Symbol symbol, FormattableString type, Resolution? resolution)
 Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...) More...
 
string CreateIndicatorName (Symbol symbol, string type, Resolution? resolution)
 Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...) More...
 
void RegisterIndicator (Symbol symbol, IndicatorBase< IndicatorDataPoint > indicator, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator (Symbol symbol, IndicatorBase< IndicatorDataPoint > indicator, TimeSpan? resolution=null, Func< IBaseData, decimal > selector=null)
 Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator (Symbol symbol, IndicatorBase< IndicatorDataPoint > indicator, IDataConsolidator consolidator, Func< IBaseData, decimal > selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, Resolution? resolution=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, Resolution? resolution, Func< IBaseData, T > selector)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, TimeSpan? resolution, Func< IBaseData, T > selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, IDataConsolidator consolidator, Func< IBaseData, T > selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
IndicatorBase< IndicatorDataPointWarmUpIndicator (Symbol symbol, IndicatorBase< IndicatorDataPoint > indicator, Resolution? resolution=null, Func< IBaseData, decimal > selector=null)
 Warms up a given indicator with historical data More...
 
IndicatorBase< IndicatorDataPointWarmUpIndicator (Symbol symbol, IndicatorBase< IndicatorDataPoint > indicator, TimeSpan period, Func< IBaseData, decimal > selector=null)
 Warms up a given indicator with historical data More...
 
IndicatorBase< T > WarmUpIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, Resolution? resolution=null, Func< IBaseData, T > selector=null)
 Warms up a given indicator with historical data More...
 
IndicatorBase< T > WarmUpIndicator< T > (Symbol symbol, IndicatorBase< T > indicator, TimeSpan period, Func< IBaseData, T > selector=null)
 Warms up a given indicator with historical data More...
 
IDataConsolidator ResolveConsolidator (Symbol symbol, Resolution? resolution, Type dataType=null)
 Gets the default consolidator for the specified symbol and resolution More...
 
IDataConsolidator ResolveConsolidator (Symbol symbol, TimeSpan? timeSpan, Type dataType=null)
 Gets the default consolidator for the specified symbol and resolution More...
 
IDataConsolidator Consolidate (Symbol symbol, Resolution period, Action< TradeBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, TimeSpan period, Action< TradeBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, Resolution period, Action< QuoteBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, TimeSpan period, Action< QuoteBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate< T > (Symbol symbol, TimeSpan period, Action< T > handler)
 Registers the handler to receive consolidated data for the specified symbol and tick type. The handler and tick type must match. More...
 
IDataConsolidator Consolidate< T > (Symbol symbol, Resolution period, TickType? tickType, Action< T > handler)
 Registers the handler to receive consolidated data for the specified symbol and tick type. The handler and tick type must match. More...
 
IDataConsolidator Consolidate< T > (Symbol symbol, TimeSpan period, TickType? tickType, Action< T > handler)
 Registers the handler to receive consolidated data for the specified symbol and tick type. The handler and tick type must match. More...
 
IDataConsolidator Consolidate (Symbol symbol, Func< DateTime, CalendarInfo > calendar, Action< QuoteBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, Func< DateTime, CalendarInfo > calendar, Action< TradeBar > handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate< T > (Symbol symbol, Func< DateTime, CalendarInfo > calendar, Action< T > handler)
 Registers the handler to receive consolidated data for the specified symbol and tick type. The handler and tick type must match. More...
 
void AddChart (Chart chart)
 Add a Chart object to algorithm collection More...
 
void Plot (string series, decimal value)
 Plot a chart using string series name, with value. More...
 
void Record (string series, int value)
 Plot a chart using string series name, with int value. Alias of Plot(); More...
 
void Record (string series, double value)
 Plot a chart using string series name, with double value. Alias of Plot(); More...
 
void Record (string series, decimal value)
 Plot a chart using string series name, with decimal value. Alias of Plot(); More...
 
void Plot (string series, double value)
 Plot a chart using string series name, with double value. More...
 
void Plot (string series, int value)
 Plot a chart using string series name, with int value. More...
 
void Plot (string series, float value)
 Plot a chart using string series name, with float value. More...
 
void Plot (string chart, string series, double value)
 Plot a chart to string chart name, using string series name, with double value. More...
 
void Plot (string chart, string series, int value)
 Plot a chart to string chart name, using string series name, with int value More...
 
void Plot (string chart, string series, float value)
 Plot a chart to string chart name, using string series name, with float value More...
 
void Plot (string chart, string series, decimal value)
 Plot a value to a chart of string-chart name, with string series name, and decimal value. If chart does not exist, create it. More...
 
void AddSeries (string chart, string series, SeriesType seriesType, string unit="$")
 Add a series object for charting. This is useful when initializing charts with series other than type = line. If a series exists in the chart with the same name, then it is replaced. More...
 
void Plot< T > (string chart, params IndicatorBase< T >[] indicators)
 Plots the value of each indicator on the chart More...
 
void PlotIndicator< T > (string chart, params IndicatorBase< T >[] indicators)
 Automatically plots each indicator when a new value is available More...
 
void PlotIndicator< T > (string chart, bool waitForReady, params IndicatorBase< T >[] indicators)
 Automatically plots each indicator when a new value is available, optionally waiting for indicator.IsReady to return true More...
 
void SetRuntimeStatistic (string name, string value)
 Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI. More...
 
void SetRuntimeStatistic (string name, decimal value)
 Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI. More...
 
void SetRuntimeStatistic (string name, int value)
 Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI. More...
 
void SetRuntimeStatistic (string name, double value)
 Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI. More...
 
List< ChartGetChartUpdates (bool clearChartData=false)
 Get the chart updates by fetch the recent points added and return for dynamic plotting. More...
 
void SetPandasConverter ()
 Sets pandas converter More...
 
Security AddData (PyObject type, string ticker, Resolution? resolution=null)
 AddData a new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time). This method is meant for custom data types that require a ticker, but have no underlying Symbol. Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data More...
 
Security AddData (PyObject type, Symbol underlying, Resolution? resolution=null)
 AddData a new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time). This adds a Symbol to the Underlying property in the custom data Symbol object. Use this method when adding custom data with a ticker from the past, such as "AOL" before it became "TWX", or if you need to filter using custom data and place trades on the Symbol associated with the custom data. More...
 
Security AddData (PyObject type, string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillDataForward=false, decimal leverage=1.0m)
 AddData a new user defined data source, requiring only the minimum config options. This method is meant for custom data types that require a ticker, but have no underlying Symbol. Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data More...
 
Security AddData (PyObject type, Symbol underlying, Resolution? resolution, DateTimeZone timeZone, bool fillDataForward=false, decimal leverage=1.0m)
 AddData a new user defined data source, requiring only the minimum config options. This adds a Symbol to the Underlying property in the custom data Symbol object. Use this method when adding custom data with a ticker from the past, such as "AOL" before it became "TWX", or if you need to filter using custom data and place trades on the Symbol associated with the custom data. More...
 
Security AddData (Type dataType, string ticker, Resolution? resolution, DateTimeZone timeZone, bool fillDataForward=false, decimal leverage=1.0m)
 AddData a new user defined data source, requiring only the minimum config options. This method is meant for custom data types that require a ticker, but have no underlying Symbol. Examples of data sources that meet this criteria are U.S. Treasury Yield Curve Rates and Trading Economics data More...
 
Security AddData (Type dataType, Symbol underlying, Resolution? resolution=null, DateTimeZone timeZone=null, bool fillDataForward=false, decimal leverage=1.0m)
 AddData a new user defined data source, requiring only the minimum config options. This adds a Symbol to the Underlying property in the custom data Symbol object. Use this method when adding custom data with a ticker from the past, such as "AOL" before it became "TWX", or if you need to filter using custom data and place trades on the Symbol associated with the custom data. More...
 
Security AddData (PyObject type, string ticker, SymbolProperties properties, SecurityExchangeHours exchangeHours, Resolution? resolution=null, bool fillDataForward=false, decimal leverage=1.0m)
 AddData a new user defined data source including symbol properties and exchange hours, all other vars are not required and will use defaults. This overload reflects the C# equivalent for custom properties and market hours More...
 
void AddFutureOption (Symbol futureSymbol, PyObject optionFilter)
 Creates and adds a new Future Option contract to the algorithm. More...
 
Universe AddUniverse (PyObject pyObject)
 Creates a new universe and adds it to the algorithm. This is for coarse fundamental US Equity data and will be executed on day changes in the NewYork time zone (TimeZones.NewYork More...
 
Universe AddUniverse (PyObject pyObject, PyObject pyfine)
 Creates a new universe and adds it to the algorithm. This is for coarse and fine fundamental US Equity data and will be executed on day changes in the NewYork time zone (TimeZones.NewYork More...
 
Universe AddUniverse (string name, Resolution resolution, PyObject pySelector)
 Creates a new universe and adds it to the algorithm. This can be used to return a list of string symbols retrieved from anywhere and will loads those symbols under the US Equity market. More...
 
Universe AddUniverse (string name, PyObject pySelector)
 Creates a new universe and adds it to the algorithm. This can be used to return a list of string symbols retrieved from anywhere and will loads those symbols under the US Equity market. More...
 
Universe AddUniverse (SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, PyObject pySelector)
 Creates a new user defined universe that will fire on the requested resolution during market hours. More...
 
Universe AddUniverse (PyObject T, string name, PyObject selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings More...
 
Universe AddUniverse (PyObject T, string name, Resolution resolution, PyObject selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Market.USA and UniverseSettings More...
 
Universe AddUniverse (PyObject T, string name, Resolution resolution, UniverseSettings universeSettings, PyObject selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, and Market.USA More...
 
Universe AddUniverse (PyObject T, string name, UniverseSettings universeSettings, PyObject selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, and Market.USA More...
 
Universe AddUniverse (PyObject T, SecurityType securityType, string name, Resolution resolution, string market, PyObject selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. More...
 
Universe AddUniverse (PyObject T, SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, PyObject selector)
 Creates a new universe and adds it to the algorithm More...
 
Universe AddUniverse (Type dataType, SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, PyObject pySelector)
 Creates a new universe and adds it to the algorithm More...
 
void AddUniverseOptions (PyObject universe, PyObject optionFilter)
 Creates a new universe selection model and adds it to the algorithm. This universe selection model will chain to the security changes of a given Universe selection output and create a new OptionChainUniverse for each of them More...
 
void RegisterIndicator (Symbol symbol, PyObject indicator, Resolution? resolution=null, PyObject selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator (Symbol symbol, PyObject indicator, TimeSpan? resolution=null, PyObject selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator (Symbol symbol, PyObject indicator, PyObject pyObject, PyObject selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void RegisterIndicator (Symbol symbol, PyObject indicator, IDataConsolidator consolidator, PyObject selector=null)
 Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator. More...
 
void Plot (string series, PyObject pyObject)
 Plot a chart using string series name, with value. More...
 
void Plot (string chart, Indicator first, Indicator second=null, Indicator third=null, Indicator fourth=null)
 Plots the value of each indicator on the chart More...
 
void Plot (string chart, BarIndicator first, BarIndicator second=null, BarIndicator third=null, BarIndicator fourth=null)
 Plots the value of each indicator on the chart More...
 
void Plot (string chart, TradeBarIndicator first, TradeBarIndicator second=null, TradeBarIndicator third=null, TradeBarIndicator fourth=null)
 Plots the value of each indicator on the chart More...
 
void PlotIndicator (string chart, PyObject first, PyObject second=null, PyObject third=null, PyObject fourth=null)
 Automatically plots each indicator when a new value is available More...
 
void PlotIndicator (string chart, bool waitForReady, PyObject first, PyObject second=null, PyObject third=null, PyObject fourth=null)
 Automatically plots each indicator when a new value is available More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, PyObject selector=null, PyObject filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, Resolution resolution, PyObject selector=null, PyObject filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
FilteredIdentity FilteredIdentity (Symbol symbol, TimeSpan resolution, PyObject selector=null, PyObject filter=null, string fieldName=null)
 Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution More...
 
PyObject History (PyObject tickers, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbol. The exact number of bars will be returned. The symbol must exist in the Securities collection. More...
 
PyObject History (PyObject tickers, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbols over the requested span. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject tickers, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbol between the specified dates. The symbol must exist in the Securities collection. More...
 
PyObject History (PyObject type, PyObject tickers, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject type, PyObject tickers, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject type, PyObject tickers, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbols over the requested span. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject type, Symbol symbol, DateTime start, DateTime end, Resolution? resolution=null)
 Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject type, Symbol symbol, int periods, Resolution? resolution=null)
 Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection. More...
 
PyObject History (PyObject type, Symbol symbol, TimeSpan span, Resolution? resolution=null)
 Gets the historical data for the specified symbols over the requested span. The symbols must exist in the Securities collection. More...
 
void SetBenchmark (PyObject benchmark)
 Sets the specified function as the benchmark, this function provides the value of the benchmark at each date/time requested More...
 
void SetBrokerageModel (PyObject model)
 Sets the brokerage to emulate in backtesting or paper trading. This can be used to set a custom brokerage model. More...
 
void SetSecurityInitializer (PyObject securityInitializer)
 Sets the security initializer function, used to initialize/configure securities after creation More...
 
string Download (string address, PyObject headers)
 Downloads the requested resource as a string. The resource to download is specified as a string containing the URI. More...
 
string Download (string address, PyObject headers, string userName, string password)
 Downloads the requested resource as a string. The resource to download is specified as a string containing the URI. More...
 
void Debug (PyObject message)
 Send a debug message to the web console: More...
 
void Error (PyObject message)
 Send a string error message to the Console. More...
 
void Log (PyObject message)
 Added another method for logging if user guessed. More...
 
void Quit (PyObject message)
 Terminate the algorithm after processing the current event handler. More...
 
IDataConsolidator Consolidate (Symbol symbol, Resolution period, PyObject handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, Resolution period, TickType? tickType, PyObject handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, TimeSpan period, PyObject handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, TimeSpan period, TickType? tickType, PyObject handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
IDataConsolidator Consolidate (Symbol symbol, Func< DateTime, CalendarInfo > calendar, PyObject handler)
 Registers the handler to receive consolidated data for the specified symbol More...
 
ScheduledEvent Train (PyObject trainingCode)
 Schedules the provided training code to execute immediately More...
 
ScheduledEvent Train (IDateRule dateRule, ITimeRule timeRule, PyObject trainingCode)
 Schedules the training code to run using the specified date and time rules More...
 
OrderTicket Buy (Symbol symbol, int quantity)
 Buy Stock (Alias of Order) More...
 
OrderTicket Buy (Symbol symbol, double quantity)
 Buy Stock (Alias of Order) More...
 
OrderTicket Buy (Symbol symbol, decimal quantity)
 Buy Stock (Alias of Order) More...
 
OrderTicket Buy (Symbol symbol, float quantity)
 Buy Stock (Alias of Order) More...
 
OrderTicket Sell (Symbol symbol, int quantity)
 Sell stock (alias of Order) More...
 
OrderTicket Sell (Symbol symbol, double quantity)
 Sell stock (alias of Order) More...
 
OrderTicket Sell (Symbol symbol, float quantity)
 Sell stock (alias of Order) More...
 
OrderTicket Sell (Symbol symbol, decimal quantity)
 Sell stock (alias of Order) More...
 
OrderTicket Order (Symbol symbol, double quantity)
 Issue an order/trade for asset: Alias wrapper for Order(string, int); More...
 
OrderTicket Order (Symbol symbol, int quantity)
 Issue an order/trade for asset More...
 
OrderTicket Order (Symbol symbol, decimal quantity)
 Issue an order/trade for asset More...
 
OrderTicket Order (Symbol symbol, decimal quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Wrapper for market order method: submit a new order for quantity of symbol using type order. More...
 
OrderTicket MarketOrder (Symbol symbol, int quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Market order implementation: Send a market order and wait for it to be filled. More...
 
OrderTicket MarketOrder (Symbol symbol, double quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Market order implementation: Send a market order and wait for it to be filled. More...
 
OrderTicket MarketOrder (Symbol symbol, decimal quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Market order implementation: Send a market order and wait for it to be filled. More...
 
OrderTicket MarketOrder (Security security, decimal quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Market order implementation: Send a market order and wait for it to be filled. More...
 
OrderTicket MarketOnOpenOrder (Symbol symbol, double quantity, string tag="", IOrderProperties orderProperties=null)
 Market on open order implementation: Send a market order when the exchange opens More...
 
OrderTicket MarketOnOpenOrder (Symbol symbol, int quantity, string tag="", IOrderProperties orderProperties=null)
 Market on open order implementation: Send a market order when the exchange opens More...
 
OrderTicket MarketOnOpenOrder (Symbol symbol, decimal quantity, string tag="", IOrderProperties orderProperties=null)
 Market on open order implementation: Send a market order when the exchange opens More...
 
OrderTicket MarketOnCloseOrder (Symbol symbol, int quantity, string tag="", IOrderProperties orderProperties=null)
 Market on close order implementation: Send a market order when the exchange closes More...
 
OrderTicket MarketOnCloseOrder (Symbol symbol, double quantity, string tag="", IOrderProperties orderProperties=null)
 Market on close order implementation: Send a market order when the exchange closes More...
 
OrderTicket MarketOnCloseOrder (Symbol symbol, decimal quantity, string tag="", IOrderProperties orderProperties=null)
 Market on close order implementation: Send a market order when the exchange closes More...
 
OrderTicket LimitOrder (Symbol symbol, int quantity, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit order to the transaction handler: More...
 
OrderTicket LimitOrder (Symbol symbol, double quantity, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit order to the transaction handler: More...
 
OrderTicket LimitOrder (Symbol symbol, decimal quantity, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit order to the transaction handler: More...
 
OrderTicket StopMarketOrder (Symbol symbol, int quantity, decimal stopPrice, string tag="", IOrderProperties orderProperties=null)
 Create a stop market order and return the newly created order id; or negative if the order is invalid More...
 
OrderTicket StopMarketOrder (Symbol symbol, double quantity, decimal stopPrice, string tag="", IOrderProperties orderProperties=null)
 Create a stop market order and return the newly created order id; or negative if the order is invalid More...
 
OrderTicket StopMarketOrder (Symbol symbol, decimal quantity, decimal stopPrice, string tag="", IOrderProperties orderProperties=null)
 Create a stop market order and return the newly created order id; or negative if the order is invalid More...
 
OrderTicket StopLimitOrder (Symbol symbol, int quantity, decimal stopPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a stop limit order to the transaction handler: More...
 
OrderTicket StopLimitOrder (Symbol symbol, double quantity, decimal stopPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a stop limit order to the transaction handler: More...
 
OrderTicket StopLimitOrder (Symbol symbol, decimal quantity, decimal stopPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a stop limit order to the transaction handler: More...
 
OrderTicket LimitIfTouchedOrder (Symbol symbol, int quantity, decimal triggerPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit if touched order to the transaction handler: More...
 
OrderTicket LimitIfTouchedOrder (Symbol symbol, double quantity, decimal triggerPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit if touched order to the transaction handler: More...
 
OrderTicket LimitIfTouchedOrder (Symbol symbol, decimal quantity, decimal triggerPrice, decimal limitPrice, string tag="", IOrderProperties orderProperties=null)
 Send a limit if touched order to the transaction handler: More...
 
OrderTicket ExerciseOption (Symbol optionSymbol, int quantity, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Send an exercise order to the transaction handler More...
 
IEnumerable< OrderTicketBuy (OptionStrategy strategy, int quantity, IOrderProperties orderProperties=null)
 Buy Option Strategy (Alias of Order) More...
 
IEnumerable< OrderTicketSell (OptionStrategy strategy, int quantity, IOrderProperties orderProperties=null)
 Sell Option Strategy (alias of Order) More...
 
IEnumerable< OrderTicketOrder (OptionStrategy strategy, int quantity, IOrderProperties orderProperties=null)
 Issue an order/trade for buying/selling an option strategy More...
 
List< int > Liquidate (Symbol symbolToLiquidate=null, string tag="Liquidated")
 Liquidate all holdings and cancel open orders. Called at the end of day for tick-strategies. More...
 
void SetMaximumOrders (int max)
 Maximum number of orders for the algorithm More...
 
void SetHoldings (List< PortfolioTarget > targets, bool liquidateExistingHoldings=false, string tag="", IOrderProperties orderProperties=null)
 Sets holdings for a collection of targets. The implementation will order the provided targets executing first those that reduce a position, freeing margin. More...
 
void SetHoldings (Symbol symbol, double percentage, bool liquidateExistingHoldings=false, string tag="", IOrderProperties orderProperties=null)
 Alias for SetHoldings to avoid the M-decimal errors. More...
 
void SetHoldings (Symbol symbol, float percentage, bool liquidateExistingHoldings=false, string tag="", IOrderProperties orderProperties=null)
 Alias for SetHoldings to avoid the M-decimal errors. More...
 
void SetHoldings (Symbol symbol, int percentage, bool liquidateExistingHoldings=false, string tag="", IOrderProperties orderProperties=null)
 Alias for SetHoldings to avoid the M-decimal errors. More...
 
void SetHoldings (Symbol symbol, decimal percentage, bool liquidateExistingHoldings=false, string tag="", IOrderProperties orderProperties=null)
 Automatically place a market order which will set the holdings to between 100% or -100% of PORTFOLIO VALUE. E.g. SetHoldings("AAPL", 0.1); SetHoldings("IBM", -0.2); -> Sets portfolio as long 10% APPL and short 20% IBM E.g. SetHoldings("AAPL", 2); -> Sets apple to 2x leveraged with all our cash. If the market is closed, place a market on open order. More...
 
decimal CalculateOrderQuantity (Symbol symbol, double target)
 Calculate the order quantity to achieve target-percent holdings. More...
 
decimal CalculateOrderQuantity (Symbol symbol, decimal target)
 Calculate the order quantity to achieve target-percent holdings. More...
 
OrderTicket Order (Symbol symbol, int quantity, OrderType type, bool asynchronous=false, string tag="", IOrderProperties orderProperties=null)
 Obsolete implementation of Order method accepting a OrderType. This was deprecated since it was impossible to generate other orders via this method. Any calls to this method will always default to a Market Order. More...
 
OrderTicket Order (Symbol symbol, decimal quantity, OrderType type)
 Obsolete method for placing orders. More...
 
OrderTicket Order (Symbol symbol, int quantity, OrderType type)
 Obsolete method for placing orders. More...
 
bool IsMarketOpen (Symbol symbol)
 Determines if the exchange for the specified symbol is open at the current time. 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...
 
Universe AddUniverse (Universe universe)
 Adds the universe to the algorithm More...
 
Universe AddUniverse< T > (string name, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings More...
 
Universe AddUniverse< T > (string name, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, Market.USA, and UniverseSettings More...
 
Universe AddUniverse< T > (string name, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, and Market.USA More...
 
Universe AddUniverse< T > (string name, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Resolution.Daily, and Market.USA More...
 
Universe AddUniverse< T > (string name, Resolution resolution, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Market.USA and UniverseSettings More...
 
Universe AddUniverse< T > (string name, Resolution resolution, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, Market.USA and UniverseSettings More...
 
Universe AddUniverse< T > (string name, Resolution resolution, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, and Market.USA More...
 
Universe AddUniverse< T > (string name, Resolution resolution, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. This universe will use the defaults of SecurityType.Equity, and Market.USA More...
 
Universe AddUniverse< T > (SecurityType securityType, string name, Resolution resolution, string market, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. More...
 
Universe AddUniverse< T > (SecurityType securityType, string name, Resolution resolution, string market, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This will use the default universe settings specified via the UniverseSettings property. More...
 
Universe AddUniverse< T > (SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm More...
 
Universe AddUniverse< T > (SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, Func< IEnumerable< T >, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm More...
 
Universe AddUniverse (Func< IEnumerable< CoarseFundamental >, IEnumerable< Symbol >> selector)
 Creates a new universe and adds it to the algorithm. This is for coarse fundamental US Equity data and will be executed on day changes in the NewYork time zone (TimeZones.NewYork More...
 
Universe AddUniverse (Func< IEnumerable< CoarseFundamental >, IEnumerable< Symbol >> coarseSelector, Func< IEnumerable< FineFundamental >, IEnumerable< Symbol >> fineSelector)
 Creates a new universe and adds it to the algorithm. This is for coarse and fine fundamental US Equity data and will be executed on day changes in the NewYork time zone (TimeZones.NewYork More...
 
Universe AddUniverse (Universe universe, Func< IEnumerable< FineFundamental >, IEnumerable< Symbol >> fineSelector)
 Creates a new universe and adds it to the algorithm. This is for fine fundamental US Equity data and will be executed on day changes in the NewYork time zone (TimeZones.NewYork More...
 
Universe AddUniverse (string name, Func< DateTime, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This can be used to return a list of string symbols retrieved from anywhere and will loads those symbols under the US Equity market. More...
 
Universe AddUniverse (string name, Resolution resolution, Func< DateTime, IEnumerable< string >> selector)
 Creates a new universe and adds it to the algorithm. This can be used to return a list of string symbols retrieved from anywhere and will loads those symbols under the US Equity market. More...
 
Universe AddUniverse (SecurityType securityType, string name, Resolution resolution, string market, UniverseSettings universeSettings, Func< DateTime, IEnumerable< string >> selector)
 Creates a new user defined universe that will fire on the requested resolution during market hours. More...
 
void AddUniverseOptions (Symbol underlyingSymbol, Func< OptionFilterUniverse, OptionFilterUniverse > optionFilter)
 Adds a new universe that creates options of the security by monitoring any changes in the Universe the provided security is in. Additionally, a filter can be applied to the options generated when the universe of the security changes. More...
 
void AddUniverseOptions (Universe universe, Func< OptionFilterUniverse, OptionFilterUniverse > optionFilter)
 Creates a new universe selection model and adds it to the algorithm. This universe selection model will chain to the security changes of a given Universe selection output and create a new OptionChainUniverse for each of them More...
 

Static Public Member Functions

static IDataConsolidator CreateConsolidator (TimeSpan period, Type consolidatorInputType, TickType? tickType=null)
 Creates a new consolidator for the specified period, generating the requested output type. More...
 

Public Attributes

IReadOnlyDictionary< Symbol, SecurityActiveSecurities => UniverseManager.ActiveSecurities
 Read-only dictionary containing all active securities. An active security is a security that is currently selected by the universe or has holdings or open orders. More...
 
string AccountCurrency => Portfolio.CashBook.AccountCurrency
 Gets the account currency More...
 
ITimeKeeper TimeKeeper => _timeKeeper
 Gets the time keeper instance More...
 

Properties

MarketHoursDatabase MarketHoursDatabase [get]
 Gets the market hours database in use by this algorithm More...
 
SymbolPropertiesDatabase SymbolPropertiesDatabase [get]
 Gets the symbol properties database in use by this algorithm More...
 
SecurityManager Securities [get, set]
 Security collection is an array of the security objects such as Equities and FOREX. Securities data manages the properties of tradeable assets such as price, open and close time and holdings information. More...
 
SecurityPortfolioManager Portfolio [get, set]
 Portfolio object provieds easy access to the underlying security-holding properties; summed together in a way to make them useful. This saves the user time by providing common portfolio requests in a single More...
 
SubscriptionManager SubscriptionManager [get, set]
 Generic Data Manager - Required for compiling all data feeds in order, and passing them into algorithm event methods. The subscription manager contains a list of the data feed's we're subscribed to and properties of each data feed. More...
 
IBrokerageModel BrokerageModel [get]
 Gets the brokerage model - used to model interactions with specific brokerages. 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, set]
 Notification Manager for Sending Live Runtime Notifications to users about important events. More...
 
ScheduleManager Schedule [get]
 Gets schedule manager for adding/removing scheduled events More...
 
AlgorithmStatus Status [get, set]
 Gets or sets the current status of the algorithm More...
 
ISecurityInitializer SecurityInitializer [get]
 Gets an instance that is to be used to initialize newly created securities. More...
 
ITradeBuilder TradeBuilder [get]
 Gets the Trade Builder to generate trades from executions More...
 
CandlestickPatterns CandlestickPatterns [get]
 Gets an instance to access the candlestick pattern helper methods More...
 
DateRules DateRules [get]
 Gets the date rules helper object to make specifying dates for events easier More...
 
TimeRules TimeRules [get]
 Gets the time rules helper object to make specifying times for events easier More...
 
TradingCalendar TradingCalendar [get]
 Gets trading calendar populated with trading events 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...
 
IOrderProperties DefaultOrderProperties [get, set]
 Gets the default order properties More...
 
string Name [get, set]
 Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting the algorithm-id. More...
 
DateTime Time [get]
 Read-only value for current time frontier of the algorithm in terms of the TimeZone More...
 
DateTime UtcTime [get]
 Current date/time in UTC. More...
 
DateTimeZone TimeZone [get]
 Gets the time zone used for the Time property. The default value is TimeZones.NewYork More...
 
DateTime StartDate [get]
 Value of the user set start-date from the backtest. More...
 
DateTime EndDate [get]
 Value of the user set start-date from the backtest. Controls the period of the backtest. More...
 
string AlgorithmId [get]
 Algorithm Id for this backtest or live algorithm. More...
 
bool LiveMode [get]
 Boolean property indicating the algorithm is currently running in live mode. More...
 
ConcurrentQueue< string > DebugMessages [get, set]
 Storage for debugging messages before the event handler has passed control back to the Lean Engine. More...
 
ConcurrentQueue< string > LogMessages [get, set]
 Storage for log messages before the event handlers have passed control back to the Lean Engine. More...
 
Exception RunTimeError [get, set]
 Gets the run time error from the algorithm, or null if none was encountered. More...
 
ConcurrentQueue< string > ErrorMessages [get, set]
 List of error messages generated by the user's code calling the "Error" function. More...
 
Slice CurrentSlice [get]
 Returns the current Slice object More...
 
ObjectStore ObjectStore [get]
 Gets the object store, used for persistence More...
 
IBenchmark Benchmark [get]
 Benchmark More...
 
bool DebugMode [get, set]
 Enables additional logging of framework models including: All insights, portfolio targets, order events, and any risk management altered targets More...
 
IUniverseSelectionModel UniverseSelection [get, set]
 Gets or sets the universe selection model. More...
 
IAlphaModel Alpha [get, set]
 Gets or sets the alpha model More...
 
IPortfolioConstructionModel PortfolioConstruction [get, set]
 Gets or sets the portfolio construction model More...
 
IExecutionModel Execution [get, set]
 Gets or sets the execution model More...
 
IRiskManagementModel RiskManagement [get, set]
 Gets or sets the risk management model More...
 
IHistoryProvider HistoryProvider [get, set]
 Gets or sets the history provider for the algorithm More...
 
bool IsWarmingUp [get]
 Gets whether or not this algorithm is still warming up More...
 
bool EnableAutomaticIndicatorWarmUp = false [get, set]
 Gets whether or not WarmUpIndicator is allowed to warm up indicators/> More...
 
ConcurrentDictionary< string, string > RuntimeStatistics = new ConcurrentDictionary<string, string>() [get]
 Access to the runtime statistics property. User provided statistics. More...
 
PandasConverter PandasConverter [get]
 PandasConverter for this Algorithm More...
 
SecurityTransactionManager Transactions [get, set]
 Transaction Manager - Process transaction fills and order management. More...
 
UniverseManager UniverseManager [get]
 Gets universe manager which holds universes keyed by their symbol More...
 
UniverseSettings UniverseSettings [get]
 Gets the universe settings to be used when adding securities via universe selection More...
 
UniverseDefinitions Universe [get]
 Gets a helper that provides pre-defined universe definitions, such as top dollar volume More...
 

Events

AlgorithmEvent< GeneratedInsightsCollectionInsightsGenerated
 Event fired when the algorithm generates insights More...
 

Detailed Description

QC Algorithm Base Class - Handle the basic requirements of a trading algorithm, allowing user to focus on event methods. The QCAlgorithm class implements Portfolio, Securities, Transactions and Data Subscription Management.

Definition at line 58 of file QCAlgorithm.cs.

Constructor & Destructor Documentation

◆ QCAlgorithm()

QuantConnect.Algorithm.QCAlgorithm.QCAlgorithm ( )

QCAlgorithm Base Class Constructor - Initialize the underlying QCAlgorithm components. QCAlgorithm manages the transactions, portfolio, charting and security subscriptions for the users algorithms.

Definition at line 108 of file QCAlgorithm.cs.

Member Function Documentation

◆ Initialize()

virtual void QuantConnect.Algorithm.QCAlgorithm.Initialize ( )
virtual

Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.

See also
SetStartDate(DateTime), SetEndDate(DateTime), SetCash(decimal)

Reimplemented in QuantConnect.Report.PortfolioLooperAlgorithm.

Definition at line 512 of file QCAlgorithm.cs.

◆ PostInitialize()

virtual void QuantConnect.Algorithm.QCAlgorithm.PostInitialize ( )
virtual

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

Definition at line 522 of file QCAlgorithm.cs.

◆ OnWarmupFinished()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnWarmupFinished ( )
virtual

Called when the algorithm has completed initialization and warm up.

Definition at line 583 of file QCAlgorithm.cs.

◆ GetParameter()

string QuantConnect.Algorithm.QCAlgorithm.GetParameter ( string  name)

Gets the parameter with the specified name. If a parameter with the specified name does not exist, null is returned

Parameters
nameThe name of the parameter to get
Returns
The value of the specified parameter, or null if not found

Definition at line 593 of file QCAlgorithm.cs.

◆ GetParameters()

IReadOnlyDictionary<string, string> QuantConnect.Algorithm.QCAlgorithm.GetParameters ( )

Gets a read-only dictionary with all current parameters

Definition at line 602 of file QCAlgorithm.cs.

◆ SetParameters()

void QuantConnect.Algorithm.QCAlgorithm.SetParameters ( Dictionary< string, string >  parameters)

Sets the parameters from the dictionary

Parameters
parametersDictionary containing the parameter names to values

Definition at line 611 of file QCAlgorithm.cs.

◆ SetAvailableDataTypes()

void QuantConnect.Algorithm.QCAlgorithm.SetAvailableDataTypes ( Dictionary< SecurityType, List< TickType >>  availableDataTypes)

Set the available data feeds in the SecurityManager

Parameters
availableDataTypesThe different TickType each Security supports

Definition at line 629 of file QCAlgorithm.cs.

◆ SetSecurityInitializer() [1/4]

void QuantConnect.Algorithm.QCAlgorithm.SetSecurityInitializer ( ISecurityInitializer  securityInitializer)

Sets the security initializer, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities.

Parameters
securityInitializerThe security initializer

Definition at line 647 of file QCAlgorithm.cs.

◆ SetSecurityInitializer() [2/4]

void QuantConnect.Algorithm.QCAlgorithm.SetSecurityInitializer ( Action< Security, bool >  securityInitializer)

Sets the security initializer function, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities.

Parameters
securityInitializerThe security initializer function

Definition at line 671 of file QCAlgorithm.cs.

◆ SetSecurityInitializer() [3/4]

void QuantConnect.Algorithm.QCAlgorithm.SetSecurityInitializer ( Action< Security securityInitializer)

Sets the security initializer function, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities.

Parameters
securityInitializerThe security initializer function

Definition at line 681 of file QCAlgorithm.cs.

◆ SetOptionChainProvider()

void QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 690 of file QCAlgorithm.cs.

◆ SetFutureChainProvider()

void QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 699 of file QCAlgorithm.cs.

◆ OnData()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnData ( Slice  slice)
virtual

Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event

TradeBars bars = slice.Bars; Ticks ticks = slice.Ticks; TradeBar spy = slice["SPY"]; List{Tick} aaplTicks = slice["AAPL"] Quandl oil = slice["OIL"] dynamic anySymbol = slice[symbol]; DataDictionary{Quandl} allQuandlData = slice.Get{Quand} Quandl oil = slice.Get{Quandl}("OIL")

Parameters
sliceThe current slice of data keyed by symbol string

Definition at line 718 of file QCAlgorithm.cs.

◆ OnSecuritiesChanged()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnSecuritiesChanged ( SecurityChanges  changes)
virtual

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

Parameters
changesSecurity additions/removals for this time step

Definition at line 753 of file QCAlgorithm.cs.

◆ OnMarginCall()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnMarginCall ( List< SubmitOrderRequest requests)
virtual

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

Definition at line 827 of file QCAlgorithm.cs.

◆ OnMarginCallWarning()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnMarginCallWarning ( )
virtual

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

Definition at line 834 of file QCAlgorithm.cs.

◆ OnEndOfDay() [1/3]

virtual void QuantConnect.Algorithm.QCAlgorithm.OnEndOfDay ( )
virtual

End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).

Method is called 10 minutes before closing to allow user to close out position.

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

Definition at line 845 of file QCAlgorithm.cs.

◆ OnEndOfDay() [2/3]

virtual void QuantConnect.Algorithm.QCAlgorithm.OnEndOfDay ( string  symbol)
virtual

End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).

This method is left for backwards compatibility and is invoked via OnEndOfDay(Symbol), if that method is override then this method will not be called without a called to base.OnEndOfDay(string)

Parameters
symbolAsset symbol for this end of day event. Forex and equities have different closing hours.

Definition at line 858 of file QCAlgorithm.cs.

◆ OnEndOfDay() [3/3]

virtual void QuantConnect.Algorithm.QCAlgorithm.OnEndOfDay ( Symbol  symbol)
virtual

End of a trading day event handler. This method is called at the end of the algorithm day (or multiple times if trading multiple assets).

Parameters
symbolAsset symbol for this end of day event. Forex and equities have different closing hours.

Definition at line 866 of file QCAlgorithm.cs.

◆ OnEndOfAlgorithm()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnEndOfAlgorithm ( )
virtual

End of algorithm run event handler. This method is called at the end of a backtest or live trading operation. Intended for closing out logs.

Definition at line 874 of file QCAlgorithm.cs.

◆ OnOrderEvent()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnOrderEvent ( OrderEvent  orderEvent)
virtual

Order fill event handler. On an order fill update the resulting information is passed to this method.

Parameters
orderEventOrder event details containing details of the evemts

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

Definition at line 884 of file QCAlgorithm.cs.

◆ OnAssignmentOrderEvent()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnAssignmentOrderEvent ( OrderEvent  assignmentEvent)
virtual

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

Definition at line 894 of file QCAlgorithm.cs.

◆ OnBrokerageMessage()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnBrokerageMessage ( BrokerageMessageEvent  messageEvent)
virtual

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

Definition at line 902 of file QCAlgorithm.cs.

◆ OnBrokerageDisconnect()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnBrokerageDisconnect ( )
virtual

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

Definition at line 910 of file QCAlgorithm.cs.

◆ OnBrokerageReconnect()

virtual void QuantConnect.Algorithm.QCAlgorithm.OnBrokerageReconnect ( )
virtual

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

Definition at line 918 of file QCAlgorithm.cs.

◆ SetDateTime()

void QuantConnect.Algorithm.QCAlgorithm.SetDateTime ( DateTime  frontier)

Update the internal algorithm time frontier.

For internal use only to advance time.

Parameters
frontierCurrent utc datetime.

Definition at line 928 of file QCAlgorithm.cs.

◆ SetTimeZone() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetTimeZone ( string  timeZone)

Sets the time zone of the Time property in the algorithm

Parameters
timeZoneThe desired time zone

Definition at line 937 of file QCAlgorithm.cs.

◆ SetTimeZone() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetTimeZone ( DateTimeZone  timeZone)

Sets the time zone of the Time property in the algorithm

Parameters
timeZoneThe desired time zone

Definition at line 956 of file QCAlgorithm.cs.

◆ SetBrokerageModel() [1/3]

void QuantConnect.Algorithm.QCAlgorithm.SetBrokerageModel ( BrokerageName  brokerage,
AccountType  accountType = AccountType.Margin 
)

Sets the brokerage to emulate in backtesting or paper trading. This can be used for brokerages that have been implemented in LEAN

Parameters
brokerageThe brokerage to emulate
accountTypeThe account type (Cash or Margin)

Definition at line 992 of file QCAlgorithm.cs.

◆ SetBrokerageModel() [2/3]

void QuantConnect.Algorithm.QCAlgorithm.SetBrokerageModel ( IBrokerageModel  model)

Sets the brokerage to emulate in backtesting or paper trading. This can be used to set a custom brokerage model.

Parameters
modelThe brokerage model to use

Definition at line 1002 of file QCAlgorithm.cs.

◆ SetBrokerageMessageHandler()

void QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 1035 of file QCAlgorithm.cs.

◆ SetBenchmark() [1/5]

void QuantConnect.Algorithm.QCAlgorithm.SetBenchmark ( SecurityType  securityType,
string  symbol 
)

Sets the benchmark used for computing statistics of the algorithm to the specified symbol

Parameters
symbolsymbol to use as the benchmark
securityTypeIs the symbol an equity, forex, base, etc. Default SecurityType.Equity

Must use symbol that is available to the trade engine in your data store(not strictly enforced)

Definition at line 1054 of file QCAlgorithm.cs.

◆ SetBenchmark() [2/5]

void QuantConnect.Algorithm.QCAlgorithm.SetBenchmark ( string  ticker)

Sets the benchmark used for computing statistics of the algorithm to the specified ticker, defaulting to SecurityType.Equity if the ticker doesn't exist in the algorithm

Parameters
tickerTicker to use as the benchmark

Overload to accept ticker without passing SecurityType. If ticker is in portfolio it will use that SecurityType, otherwise will default to SecurityType.Equity

Definition at line 1079 of file QCAlgorithm.cs.

◆ SetBenchmark() [3/5]

void QuantConnect.Algorithm.QCAlgorithm.SetBenchmark ( Symbol  symbol)

Sets the benchmark used for computing statistics of the algorithm to the specified symbol

Parameters
symbolsymbol to use as the benchmark

Definition at line 1105 of file QCAlgorithm.cs.

◆ SetBenchmark() [4/5]

void QuantConnect.Algorithm.QCAlgorithm.SetBenchmark ( Func< DateTime, decimal >  benchmark)

Sets the specified function as the benchmark, this function provides the value of the benchmark at each date/time requested

Parameters
benchmarkThe benchmark producing function

Definition at line 1121 of file QCAlgorithm.cs.

◆ SetAccountCurrency()

void QuantConnect.Algorithm.QCAlgorithm.SetAccountCurrency ( string  accountCurrency)

Sets the account currency cash symbol this algorithm is to manage.

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

Parameters
accountCurrencyThe account currency cash symbol to set

Definition at line 1148 of file QCAlgorithm.cs.

◆ SetCash() [1/4]

void QuantConnect.Algorithm.QCAlgorithm.SetCash ( double  startingCash)

Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account.

Parameters
startingCashStarting cash for the strategy backtest

Alias of SetCash(decimal)

Definition at line 1167 of file QCAlgorithm.cs.

◆ SetCash() [2/4]

void QuantConnect.Algorithm.QCAlgorithm.SetCash ( int  startingCash)

Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account.

Parameters
startingCashStarting cash for the strategy backtest

Alias of SetCash(decimal)

Definition at line 1178 of file QCAlgorithm.cs.

◆ SetCash() [3/4]

void QuantConnect.Algorithm.QCAlgorithm.SetCash ( decimal  startingCash)

Set initial cash for the strategy while backtesting. During live mode this value is ignored and replaced with the actual cash of your brokerage account.

Parameters
startingCashStarting cash for the strategy backtest

Definition at line 1188 of file QCAlgorithm.cs.

◆ SetCash() [4/4]

void QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 1206 of file QCAlgorithm.cs.

◆ SetStartDate() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetStartDate ( int  year,
int  month,
int  day 
)

Set the start date for backtest.

Parameters
dayInt starting date 1-30
monthInt month starting date
yearInt year starting date

Wrapper for SetStartDate(DateTime). Must be less than end date. Ignored in live trading mode.

See also
SetStartDate(DateTime)

Definition at line 1228 of file QCAlgorithm.cs.

◆ SetEndDate() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetEndDate ( int  year,
int  month,
int  day 
)

Set the end date for a backtest run

Parameters
dayInt end date 1-30
monthInt month end date
yearInt year end date

Wrapper for SetEndDate(datetime).

See also
SetEndDate(DateTime)

Definition at line 1253 of file QCAlgorithm.cs.

◆ SetAlgorithmId()

void QuantConnect.Algorithm.QCAlgorithm.SetAlgorithmId ( string  algorithmId)

Set the algorithm id (backtestId or live deployId for the algorithmm).

Parameters
algorithmIdString Algorithm Id

Intended for internal QC Lean Engine use only as a setter for AlgorihthmId

Definition at line 1275 of file QCAlgorithm.cs.

◆ SetStartDate() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.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

See also
SetStartDate(int, int, int)

Definition at line 1286 of file QCAlgorithm.cs.

◆ SetEndDate() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetEndDate ( DateTime  end)

Set the end date for a backtest.

Parameters
endDatetime value for end date

Must be greater than the start date

See also
SetEndDate(int, int, int)

Definition at line 1326 of file QCAlgorithm.cs.

◆ SetLocked()

void QuantConnect.Algorithm.QCAlgorithm.SetLocked ( )

Lock the algorithm initialization to avoid user modifiying cash and data stream subscriptions

Intended for Internal QC Lean Engine use only to prevent accidental manipulation of important properties

Definition at line 1356 of file QCAlgorithm.cs.

◆ GetLocked()

bool QuantConnect.Algorithm.QCAlgorithm.GetLocked ( )

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

Definition at line 1364 of file QCAlgorithm.cs.

◆ SetLiveMode()

void QuantConnect.Algorithm.QCAlgorithm.SetLiveMode ( bool  live)

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

Definition at line 1372 of file QCAlgorithm.cs.

◆ SetTradeBuilder()

void QuantConnect.Algorithm.QCAlgorithm.SetTradeBuilder ( ITradeBuilder  tradeBuilder)

Set the ITradeBuilder implementation to generate trades from executions and market price updates

Definition at line 1392 of file QCAlgorithm.cs.

◆ AddSecurity() [1/4]

Security QuantConnect.Algorithm.QCAlgorithm.AddSecurity ( SecurityType  securityType,
string  ticker,
Resolution resolution = null,
bool  fillDataForward = true,
bool  extendedMarketHours = false 
)

Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.

Parameters
securityTypeMarketType Type: Equity, Commodity, Future, FOREX or Crypto
tickerThe security ticker
resolutionResolution of the Data Required
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
extendedMarketHoursShow the after market data as well

Definition at line 1406 of file QCAlgorithm.cs.

◆ AddSecurity() [2/4]

Security QuantConnect.Algorithm.QCAlgorithm.AddSecurity ( SecurityType  securityType,
string  ticker,
Resolution resolution,
bool  fillDataForward,
decimal  leverage,
bool  extendedMarketHours 
)

Add specified data to required list. QC will funnel this data to the handle data routine.

Parameters
securityTypeMarketType Type: Equity, Commodity, Future, FOREX or Crypto
tickerThe security ticker
resolutionResolution of the Data Required
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
extendedMarketHoursExtended market hours

AddSecurity(SecurityType securityType, Symbol symbol, Resolution resolution, bool fillDataForward, decimal leverage, bool extendedMarketHours)

Definition at line 1421 of file QCAlgorithm.cs.

◆ AddSecurity() [3/4]

Security QuantConnect.Algorithm.QCAlgorithm.AddSecurity ( SecurityType  securityType,
string  ticker,
Resolution resolution,
string  market,
bool  fillDataForward,
decimal  leverage,
bool  extendedMarketHours 
)

Set a required SecurityType-symbol and resolution for algorithm

Parameters
securityTypeMarketType Type: Equity, Commodity, Future, FOREX or Crypto
tickerThe security ticker, e.g. AAPL
resolutionResolution of the MarketType required: MarketData, Second or Minute
marketThe market the requested security belongs to, such as 'usa' or 'fxcm'
fillDataForwardIf 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

Definition at line 1436 of file QCAlgorithm.cs.

◆ AddSecurity() [4/4]

Security QuantConnect.Algorithm.QCAlgorithm.AddSecurity ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage,
bool  extendedMarketHours = false 
)

Set a required SecurityType-symbol and resolution for algorithm

Parameters
symbolThe security Symbol
resolutionResolution of the MarketType required: MarketData, Second or Minute
fillDataForwardIf 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
Returns
The new Security that was added to the algorithm

Definition at line 1485 of file QCAlgorithm.cs.

◆ AddEquity()

Equity QuantConnect.Algorithm.QCAlgorithm.AddEquity ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage,
bool  extendedMarketHours = false 
)

Creates and adds a new Equity security to the algorithm

Parameters
tickerThe equity ticker symbol
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe equity's market,
See also
Market
. Default value is null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
extendedMarketHoursTrue to send data during pre and post market sessions. Default is

false

Returns
The new Equity security

Definition at line 1540 of file QCAlgorithm.cs.

◆ AddOption() [1/2]

Option QuantConnect.Algorithm.QCAlgorithm.AddOption ( string  underlying,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new equity Option security to the algorithm

Parameters
underlyingThe underlying equity ticker
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe equity's market,
See also
Market
. Default is value null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
Returns
The new Option security

Definition at line 1554 of file QCAlgorithm.cs.

◆ AddOption() [2/2]

Option QuantConnect.Algorithm.QCAlgorithm.AddOption ( Symbol  underlying,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new Option security to the algorithm. This method can be used to add options with non-equity asset classes to the algorithm (e.g. Future Options).

Parameters
underlyingUnderlying asset Symbol to use as the option's underlying
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe option's market,
See also
Market
. Default value is null, but will be resolved using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf true, data will be provided to the algorithm every Second, Minute, Hour, or Day, while the asset is open and depending on the Resolution this option was configured to use.
leverageThe requested leverage for the
Returns
Exceptions
KeyNotFoundException

Definition at line 1580 of file QCAlgorithm.cs.

◆ AddFuture()

Future QuantConnect.Algorithm.QCAlgorithm.AddFuture ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new Future security to the algorithm

Parameters
tickerThe future ticker
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe futures market,
See also
Market
. Default is value null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
Returns
The new Future security

Definition at line 1620 of file QCAlgorithm.cs.

◆ AddFutureContract()

Future QuantConnect.Algorithm.QCAlgorithm.AddFutureContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

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
fillDataForwardIf 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
Returns
The new Future security

Definition at line 1651 of file QCAlgorithm.cs.

◆ AddFutureOption() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.AddFutureOption ( Symbol  symbol,
Func< OptionFilterUniverse, OptionFilterUniverse optionFilter = null 
)

Creates and adds a new Future Option contract to the algorithm.

Parameters
symbolThe Future canonical symbol (i.e. Symbol returned from AddFuture)
optionFilterFilter to apply to option contracts loaded as part of the universe
Returns
The new Option security, containing a Future as its underlying.
Exceptions
ArgumentExceptionThe symbol provided is not canonical.

Definition at line 1663 of file QCAlgorithm.cs.

◆ AddFutureOptionContract()

Option QuantConnect.Algorithm.QCAlgorithm.AddFutureOptionContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Adds a future option contract to the algorithm.

Parameters
symbolOption contract Symbol
resolutionResolution of the option contract, i.e. the granularity of the data
fillDataForwardIf true, this will fill in missing data points with the previous data point
leverageThe leverage to apply to the option contract
Returns
Option security
Exceptions
ArgumentExceptionSymbol is canonical (i.e. a generic Symbol returned from AddFuture or AddOption(string, Resolution?, string, bool, decimal))

Definition at line 1682 of file QCAlgorithm.cs.

◆ AddIndexOption() [1/2]

Option QuantConnect.Algorithm.QCAlgorithm.AddIndexOption ( string  ticker,
Resolution resolution = null,
string  market = Market.USA,
bool  fillDataForward = true 
)

Creates and adds index options to the algorithm.

Parameters
tickerThe ticker of the Index Option
resolutionResolution of the index option contracts, i.e. the granularity of the data
marketMarket of the index option. If no market is provided, we default to Market.USA
fillDataForwardIf true, this will fill in missing data points with the previous data point
Returns
Canonical Option security

Definition at line 1700 of file QCAlgorithm.cs.

◆ AddIndexOption() [2/2]

Option QuantConnect.Algorithm.QCAlgorithm.AddIndexOption ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true 
)

Creates and adds index options to the algorithm.

Parameters
symbolThe Symbol of the Security returned from AddIndex
resolutionResolution of the index option contracts, i.e. the granularity of the data
fillDataForwardIf true, this will fill in missing data points with the previous data point
Returns
Canonical Option security

Definition at line 1715 of file QCAlgorithm.cs.

◆ AddIndexOptionContract()

Option QuantConnect.Algorithm.QCAlgorithm.AddIndexOptionContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true 
)

Adds an index option contract to the algorithm.

Parameters
symbolSymbol of the index option contract
resolutionResolution of the index option contract, i.e. the granularity of the data
fillDataForwardIf true, this will fill in missing data points with the previous data point
Returns
Index Option Contract
Exceptions
ArgumentExceptionThe provided Symbol is not an Index Option

Definition at line 1733 of file QCAlgorithm.cs.

◆ AddOptionContract()

Option QuantConnect.Algorithm.QCAlgorithm.AddOptionContract ( Symbol  symbol,
Resolution resolution = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

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
fillDataForwardIf 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
Returns
The new Option security

Definition at line 1751 of file QCAlgorithm.cs.

◆ AddForex()

Forex QuantConnect.Algorithm.QCAlgorithm.AddForex ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new Forex security to the algorithm

Parameters
tickerThe currency pair
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe foreign exchange trading market,
See also
Market
. Default value is null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
Returns
The new Forex security

Definition at line 1820 of file QCAlgorithm.cs.

◆ AddCfd()

Cfd QuantConnect.Algorithm.QCAlgorithm.AddCfd ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new Cfd security to the algorithm

Parameters
tickerThe currency pair
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe cfd trading market,
See also
Market
. Default value is null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
Returns
The new Cfd security

Definition at line 1834 of file QCAlgorithm.cs.

◆ AddIndex()

Index QuantConnect.Algorithm.QCAlgorithm.AddIndex ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true 
)

Creates and adds a new Index security to the algorithm

Parameters
tickerThe currency pair
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe index trading market,
See also
Market
. Default value is null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf true, returns the last available data even if none in that timeslice. Default is

true

Returns
The new Index security

Definition at line 1848 of file QCAlgorithm.cs.

◆ AddCrypto()

Crypto QuantConnect.Algorithm.QCAlgorithm.AddCrypto ( string  ticker,
Resolution resolution = null,
string  market = null,
bool  fillDataForward = true,
decimal  leverage = Security.NullLeverage 
)

Creates and adds a new Crypto security to the algorithm

Parameters
tickerThe currency pair
resolutionThe Resolution of market data, Tick, Second, Minute, Hour, or Daily. Default is Resolution.Minute
marketThe cfd trading market,
See also
Market
. Default value is null and looked up using BrokerageModel.DefaultMarkets in AddSecurity<T>
fillDataForwardIf 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
Returns
The new Crypto security

Definition at line 1863 of file QCAlgorithm.cs.

◆ RemoveOptionContract()

bool QuantConnect.Algorithm.QCAlgorithm.RemoveOptionContract ( 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

Sugar syntax for AddOptionContract

Definition at line 1874 of file QCAlgorithm.cs.

◆ RemoveSecurity()

bool QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 1884 of file QCAlgorithm.cs.

◆ AddData< T >() [1/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( string  ticker,
Resolution resolution = null 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)

Parameters
tickerKey/Ticker for data
resolutionResolution of the data
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 1957 of file QCAlgorithm.cs.

◆ AddData< T >() [2/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( Symbol  underlying,
Resolution resolution = null 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)

Parameters
underlyingThe underlying symbol for the custom data
resolutionResolution of the data
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 1975 of file QCAlgorithm.cs.

◆ AddData< T >() [3/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( string  ticker,
Resolution resolution,
bool  fillDataForward,
decimal  leverage = 1.0m 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)

Parameters
tickerKey/Ticker for data
resolutionResolution of the Data Required
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 1996 of file QCAlgorithm.cs.

◆ AddData< T >() [4/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( Symbol  underlying,
Resolution resolution,
bool  fillDataForward,
decimal  leverage = 1.0m 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options. The data is added with a default time zone of NewYork (Eastern Daylight Savings Time)

Parameters
underlyingThe underlying symbol for the custom data
resolutionResolution of the Data Required
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 2012 of file QCAlgorithm.cs.

◆ AddData< T >() [5/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( string  ticker,
Resolution resolution,
DateTimeZone  timeZone,
bool  fillDataForward = false,
decimal  leverage = 1.0m 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options.

Parameters
tickerKey/Ticker for data
resolutionResolution of the Data Required
timeZoneSpecifies the time zone of the raw data
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 2028 of file QCAlgorithm.cs.

◆ AddData< T >() [6/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( Symbol  underlying,
Resolution resolution,
DateTimeZone  timeZone,
bool  fillDataForward = false,
decimal  leverage = 1.0m 
)

AddData

Template Parameters
Ta new user defined data source, requiring only the minimum config options.

Parameters
underlyingThe underlying symbol for the custom data
resolutionResolution of the Data Required
timeZoneSpecifies the time zone of the raw data
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
Returns
The new Security

Generic type T must implement base data

Type Constraints
T :IBaseData 
T :new() 

Definition at line 2044 of file QCAlgorithm.cs.

◆ AddData< T >() [7/7]

Security QuantConnect.Algorithm.QCAlgorithm.AddData< T > ( string  ticker,
SymbolProperties  properties,
SecurityExchangeHours  exchangeHours,
Resolution resolution = null,
bool  fillDataForward = false,
decimal  leverage = 1.0m 
)

AddData

Template Parameters
Ta new user defined data source including symbol properties and exchange hours, all other vars are not required and will use defaults.

Parameters
tickerKey/Ticker for data
propertiesThe properties of this new custom data
exchangeHoursThe Exchange hours of this symbol
resolutionResolution of the Data Required
fillDataForwardWhen no data available on a tradebar, return the last data that was generated
leverageCustom leverage per security
Returns
The new Security
Type Constraints
T :IBaseData 
T :new() 

Definition at line 2061 of file QCAlgorithm.cs.

◆ Debug() [1/5]

void QuantConnect.Algorithm.QCAlgorithm.Debug ( string  message)

Send a debug message to the web console:

Parameters
messageMessage to send to debug console
See also
Log(string), Error(string)

Definition at line 2080 of file QCAlgorithm.cs.

◆ Debug() [2/5]

void QuantConnect.Algorithm.QCAlgorithm.Debug ( int  message)

Send a debug message to the web console:

Parameters
messageMessage to send to debug console
See also
Log(int), Error(int)

Definition at line 2093 of file QCAlgorithm.cs.

◆ Debug() [3/5]

void QuantConnect.Algorithm.QCAlgorithm.Debug ( double  message)

Send a debug message to the web console:

Parameters
messageMessage to send to debug console
See also
Log(double), Error(double)

Definition at line 2104 of file QCAlgorithm.cs.

◆ Debug() [4/5]

void QuantConnect.Algorithm.QCAlgorithm.Debug ( decimal  message)

Send a debug message to the web console:

Parameters
messageMessage to send to debug console
See also
Log(decimal), Error(decimal)

Definition at line 2115 of file QCAlgorithm.cs.

◆ Log() [1/5]

void QuantConnect.Algorithm.QCAlgorithm.Log ( string  message)

Added another method for logging if user guessed.

Parameters
messageString message to log.
See also
Debug(string), Error(string)

Definition at line 2126 of file QCAlgorithm.cs.

◆ Log() [2/5]

void QuantConnect.Algorithm.QCAlgorithm.Log ( int  message)

Added another method for logging if user guessed.

Parameters
messageInt message to log.
See also
Debug(int), Error(int)

Definition at line 2138 of file QCAlgorithm.cs.

◆ Log() [3/5]

void QuantConnect.Algorithm.QCAlgorithm.Log ( double  message)

Added another method for logging if user guessed.

Parameters
messageDouble message to log.
See also
Debug(double), Error(double)

Definition at line 2149 of file QCAlgorithm.cs.

◆ Log() [4/5]

void QuantConnect.Algorithm.QCAlgorithm.Log ( decimal  message)

Added another method for logging if user guessed.

Parameters
messageDecimal message to log.
See also
Debug(decimal), Error(decimal)

Definition at line 2160 of file QCAlgorithm.cs.

◆ Error() [1/6]

void QuantConnect.Algorithm.QCAlgorithm.Error ( string  message)

Send a string error message to the Console.

Parameters
messageMessage to display in errors grid
See also
Debug(string), Log(string)

Definition at line 2171 of file QCAlgorithm.cs.

◆ Error() [2/6]

void QuantConnect.Algorithm.QCAlgorithm.Error ( int  message)

Send a int error message to the Console.

Parameters
messageMessage to display in errors grid
See also
Debug(int), Log(int)

Definition at line 2184 of file QCAlgorithm.cs.

◆ Error() [3/6]

void QuantConnect.Algorithm.QCAlgorithm.Error ( double  message)

Send a double error message to the Console.

Parameters
messageMessage to display in errors grid
See also
Debug(double), Log(double)

Definition at line 2195 of file QCAlgorithm.cs.

◆ Error() [4/6]

void QuantConnect.Algorithm.QCAlgorithm.Error ( decimal  message)

Send a decimal error message to the Console.

Parameters
messageMessage to display in errors grid
See also
Debug(decimal), Log(decimal)

Definition at line 2206 of file QCAlgorithm.cs.

◆ Error() [5/6]

void QuantConnect.Algorithm.QCAlgorithm.Error ( Exception  error)

Send a string error message to the Console.

Parameters
errorException object captured from a try catch loop
See also
Debug(string), Log(string)

Definition at line 2217 of file QCAlgorithm.cs.

◆ Quit() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.Quit ( string  message = "")

Terminate the algorithm after processing the current event handler.

Parameters
messageExit message to display on quitting

Definition at line 2229 of file QCAlgorithm.cs.

◆ SetQuit()

void QuantConnect.Algorithm.QCAlgorithm.SetQuit ( bool  quit)

Set the Quit flag property of the algorithm.

Intended for internal use by the QuantConnect Lean Engine only.

Parameters
quitBoolean quit state
See also
Quit(String)

Definition at line 2241 of file QCAlgorithm.cs.

◆ Symbol()

Symbol QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 2256 of file QCAlgorithm.cs.

◆ SetHistoryProvider()

void QuantConnect.Algorithm.QCAlgorithm.SetHistoryProvider ( IHistoryProvider  historyProvider)

Set the historical data provider

Parameters
historyProviderHistorical data provider

Definition at line 2293 of file QCAlgorithm.cs.

◆ SetRunTimeError()

void QuantConnect.Algorithm.QCAlgorithm.SetRunTimeError ( Exception  exception)

Set the runtime error

Parameters
exceptionRepresents error that occur during execution

Definition at line 2306 of file QCAlgorithm.cs.

◆ SetStatus()

void QuantConnect.Algorithm.QCAlgorithm.SetStatus ( AlgorithmStatus  status)

Set the state of a live deployment

Parameters
statusLive deployment status

Definition at line 2320 of file QCAlgorithm.cs.

◆ Download() [1/5]

string QuantConnect.Algorithm.QCAlgorithm.Download ( string  address)

Downloads the requested resource as a string. The resource to download is specified as a string containing the URI.

Parameters
addressA string containing the URI to download
Returns
The requested resource as a string

◆ Download() [2/5]

string QuantConnect.Algorithm.QCAlgorithm.Download ( string  address,
IEnumerable< KeyValuePair< string, string >>  headers 
)

Downloads the requested resource as a string. The resource to download is specified as a string containing the URI.

Parameters
addressA string containing the URI to download
headersDefines header values to add to the request
Returns
The requested resource as a string

◆ Download() [3/5]

string QuantConnect.Algorithm.QCAlgorithm.Download ( string  address,
IEnumerable< KeyValuePair< string, string >>  headers,
string  userName,
string  password 
)

Downloads the requested resource as a string. The resource to download is specified as a string containing the URI.

Parameters
addressA string containing the URI to download
headersDefines header values to add to the request
userNameThe user name associated with the credentials
passwordThe password for the user name associated with the credentials
Returns
The requested resource as a string

Definition at line 2351 of file QCAlgorithm.cs.

◆ Train() [1/4]

ScheduledEvent QuantConnect.Algorithm.QCAlgorithm.Train ( Action  trainingCode)

Schedules the provided training code to execute immediately

Parameters
trainingCodeThe training code to be invoked

Definition at line 2360 of file QCAlgorithm.cs.

◆ Train() [2/4]

ScheduledEvent QuantConnect.Algorithm.QCAlgorithm.Train ( IDateRule  dateRule,
ITimeRule  timeRule,
Action  trainingCode 
)

Schedules the training code to run using the specified date and time rules

Parameters
dateRuleSpecifies what dates the event should run
timeRuleSpecifies the times on those dates the event should run
trainingCodeThe training code to be invoked

Definition at line 2371 of file QCAlgorithm.cs.

◆ SetCurrentSlice()

void QuantConnect.Algorithm.QCAlgorithm.SetCurrentSlice ( Slice  slice)

Sets the current slice

Parameters
sliceThe Slice object

Definition at line 2396 of file QCAlgorithm.cs.

◆ SetApi()

void QuantConnect.Algorithm.QCAlgorithm.SetApi ( IApi  api)

Provide the API for the algorithm.

Parameters
apiInitiated API

Definition at line 2406 of file QCAlgorithm.cs.

◆ SetObjectStore()

void QuantConnect.Algorithm.QCAlgorithm.SetObjectStore ( IObjectStore  objectStore)

Sets the object store

Parameters
objectStoreThe object store

Definition at line 2415 of file QCAlgorithm.cs.

◆ Shortable() [1/2]

bool QuantConnect.Algorithm.QCAlgorithm.Shortable ( Symbol  symbol)

Determines if the Symbol is shortable at the brokerage

Parameters
symbolSymbol to check if shortable
Returns
True if shortable

Definition at line 2425 of file QCAlgorithm.cs.

◆ Shortable() [2/2]

bool QuantConnect.Algorithm.QCAlgorithm.Shortable ( Symbol  symbol,
decimal  shortQuantity 
)

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
Returns
True if shortable

Definition at line 2436 of file QCAlgorithm.cs.

◆ ShortableQuantity()

long QuantConnect.Algorithm.QCAlgorithm.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.

Definition at line 2464 of file QCAlgorithm.cs.

◆ AllShortableSymbols()

Dictionary<Symbol, long> QuantConnect.Algorithm.QCAlgorithm.AllShortableSymbols ( )

Gets all Symbols that are shortable, as well as the quantity shortable for them

Returns
All shortable Symbols, null if all Symbols are shortable

Definition at line 2474 of file QCAlgorithm.cs.

◆ ISIN()

Symbol QuantConnect.Algorithm.QCAlgorithm.ISIN ( string  isin,
DateTime?  tradingDate = null 
)

Converts an ISIN identifier into a Symbol

Parameters
isinThe International Securities Identification Number (ISIN) of an asset
tradingDateThe date that the stock being looked up is/was traded at. The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.
Returns
Symbol corresponding to the ISIN. If no Symbol with a matching ISIN was found, returns null.

Definition at line 2488 of file QCAlgorithm.cs.

◆ CompositeFIGI()

Symbol QuantConnect.Algorithm.QCAlgorithm.CompositeFIGI ( string  compositeFigi,
DateTime?  tradingDate = null 
)

Converts a composite FIGI identifier into a Symbol

Parameters
compositeFigiThe composite Financial Instrument Global Identifier (FIGI) of an asset
tradingDateThe date that the stock being looked up is/was traded at. The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.
Returns
Symbol corresponding to the composite FIGI. If no Symbol with a matching composite FIGI was found, returns null.

The composite FIGI differs from an exchange-level FIGI, in that it identifies an asset across all exchanges in a single country that the asset trades in.

Definition at line 2506 of file QCAlgorithm.cs.

◆ CUSIP()

Symbol QuantConnect.Algorithm.QCAlgorithm.CUSIP ( string  cusip,
DateTime?  tradingDate = null 
)

Converts a CUSIP identifier into a Symbol

Parameters
cusipThe CUSIP number of an asset
tradingDateThe date that the stock being looked up is/was traded at. The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.
Returns
Symbol corresponding to the CUSIP. If no Symbol with a matching CUSIP was found, returns null.

Definition at line 2520 of file QCAlgorithm.cs.

◆ SEDOL()

Symbol QuantConnect.Algorithm.QCAlgorithm.SEDOL ( string  sedol,
DateTime?  tradingDate = null 
)

Converts a SEDOL identifier into a Symbol

Parameters
sedolThe SEDOL identifier of an asset
tradingDateThe date that the stock being looked up is/was traded at. The date is used to create a Symbol with the ticker set to the ticker the asset traded under on the trading date.
Returns
Symbol corresponding to the SEDOL. If no Symbol with a matching SEDOL was found, returns null.

Definition at line 2534 of file QCAlgorithm.cs.

◆ FrameworkPostInitialize()

void QuantConnect.Algorithm.QCAlgorithm.FrameworkPostInitialize ( )

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

Definition at line 72 of file QCAlgorithm.Framework.cs.

◆ OnFrameworkData()

void QuantConnect.Algorithm.QCAlgorithm.OnFrameworkData ( Slice  slice)

Used to send data updates to algorithm framework models

Parameters
sliceThe current data slice

Definition at line 100 of file QCAlgorithm.Framework.cs.

◆ OnFrameworkSecuritiesChanged()

void QuantConnect.Algorithm.QCAlgorithm.OnFrameworkSecuritiesChanged ( SecurityChanges  changes)

Used to send security changes to algorithm framework models

Parameters
changesSecurity additions/removals for this time step

Definition at line 247 of file QCAlgorithm.Framework.cs.

◆ SetUniverseSelection() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetUniverseSelection ( IUniverseSelectionModel  universeSelection)

Sets the universe selection model

Parameters
universeSelectionModel defining universes for the algorithm

Definition at line 264 of file QCAlgorithm.Framework.cs.

◆ AddUniverseSelection() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.AddUniverseSelection ( IUniverseSelectionModel  universeSelection)

Adds a new universe selection model

Parameters
universeSelectionModel defining universes for the algorithm to add

Definition at line 273 of file QCAlgorithm.Framework.cs.

◆ SetAlpha() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetAlpha ( IAlphaModel  alpha)

Sets the alpha model

Parameters
alphaModel that generates alpha

Definition at line 297 of file QCAlgorithm.Framework.cs.

◆ AddAlpha() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.AddAlpha ( IAlphaModel  alpha)

Adds a new alpha model

Parameters
alphaModel that generates alpha to add

Definition at line 306 of file QCAlgorithm.Framework.cs.

◆ SetPortfolioConstruction() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetPortfolioConstruction ( IPortfolioConstructionModel  portfolioConstruction)

Sets the portfolio construction model

Parameters
portfolioConstructionModel defining how to build a portfolio from insights

Definition at line 330 of file QCAlgorithm.Framework.cs.

◆ SetExecution() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetExecution ( IExecutionModel  execution)

Sets the execution model

Parameters
executionModel defining how to execute trades to reach a portfolio target

Definition at line 339 of file QCAlgorithm.Framework.cs.

◆ SetRiskManagement() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.SetRiskManagement ( IRiskManagementModel  riskManagement)

Sets the risk management model

Parameters
riskManagementModel defining how risk is managed

Definition at line 348 of file QCAlgorithm.Framework.cs.

◆ AddRiskManagement() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.AddRiskManagement ( IRiskManagementModel  riskManagement)

Adds a new risk management model

Parameters
riskManagementModel defining how risk is managed to add

Definition at line 357 of file QCAlgorithm.Framework.cs.

◆ EmitInsights() [1/2]

void QuantConnect.Algorithm.QCAlgorithm.EmitInsights ( params Insight[]  insights)

Manually emit insights from an algorithm. This is typically invoked before calls to submit orders in algorithms written against QCAlgorithm that have been ported into the algorithm framework.

Parameters
insightsThe array of insights to be emitted

Definition at line 383 of file QCAlgorithm.Framework.cs.

◆ EmitInsights() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.EmitInsights ( Insight  insight)

Manually emit insights from an algorithm. This is typically invoked before calls to submit orders in algorithms written against QCAlgorithm that have been ported into the algorithm framework.

Parameters
insightThe insight to be emitted

Definition at line 406 of file QCAlgorithm.Framework.cs.

◆ SetAlpha() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetAlpha ( PyObject  alpha)

Sets the alpha model

Parameters
alphaModel that generates alpha

Definition at line 31 of file QCAlgorithm.Framework.Python.cs.

◆ AddAlpha() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.AddAlpha ( PyObject  alpha)

Adds a new alpha model

Parameters
alphaModel that generates alpha to add

Definition at line 48 of file QCAlgorithm.Framework.Python.cs.

◆ SetExecution() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetExecution ( PyObject  execution)

Sets the execution model

Parameters
executionModel defining how to execute trades to reach a portfolio target

Definition at line 65 of file QCAlgorithm.Framework.Python.cs.

◆ SetPortfolioConstruction() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetPortfolioConstruction ( PyObject  portfolioConstruction)

Sets the portfolio construction model

Parameters
portfolioConstructionModel defining how to build a portfolio from alphas

Definition at line 82 of file QCAlgorithm.Framework.Python.cs.

◆ SetUniverseSelection() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetUniverseSelection ( PyObject  universeSelection)

Sets the universe selection model

Parameters
universeSelectionModel defining universes for the algorithm

Definition at line 99 of file QCAlgorithm.Framework.Python.cs.

◆ AddUniverseSelection() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.AddUniverseSelection ( PyObject  universeSelection)

Adds a new universe selection model

Parameters
universeSelectionModel defining universes for the algorithm to add

Definition at line 113 of file QCAlgorithm.Framework.Python.cs.

◆ SetRiskManagement() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.SetRiskManagement ( PyObject  riskManagement)

Sets the risk management model

Parameters
riskManagementModel defining how risk is managed

Definition at line 127 of file QCAlgorithm.Framework.Python.cs.

◆ AddRiskManagement() [2/2]

void QuantConnect.Algorithm.QCAlgorithm.AddRiskManagement ( PyObject  riskManagement)

Adds a new risk management model

Parameters
riskManagementModel defining how risk is managed to add

Definition at line 144 of file QCAlgorithm.Framework.Python.cs.

◆ SetWarmup() [1/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmup ( TimeSpan  timeSpan)

Sets the warm up period to the specified value

Parameters
timeSpanThe amount of time to warm up, this does not take into account market hours/weekends

Definition at line 52 of file QCAlgorithm.History.cs.

◆ SetWarmUp() [1/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmUp ( TimeSpan  timeSpan)

Sets the warm up period to the specified value

Parameters
timeSpanThe amount of time to warm up, this does not take into account market hours/weekends

Definition at line 61 of file QCAlgorithm.History.cs.

◆ SetWarmup() [2/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmup ( TimeSpan  timeSpan,
Resolution resolution 
)

Sets the warm up period to the specified value

Parameters
timeSpanThe amount of time to warm up, this does not take into account market hours/weekends
resolutionThe resolution to request

Definition at line 71 of file QCAlgorithm.History.cs.

◆ SetWarmUp() [2/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmUp ( TimeSpan  timeSpan,
Resolution resolution 
)

Sets the warm up period to the specified value

Parameters
timeSpanThe amount of time to warm up, this does not take into account market hours/weekends
resolutionThe resolution to request

Definition at line 88 of file QCAlgorithm.History.cs.

◆ SetWarmup() [3/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmup ( int  barCount)

Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. The highest (smallest) resolution in the securities collection will be used. For example, if an algorithm has minute and daily data and 200 bars are requested, that would use 200 minute bars.

Parameters
barCountThe number of data points requested for warm up

Definition at line 100 of file QCAlgorithm.History.cs.

◆ SetWarmUp() [3/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmUp ( int  barCount)

Sets the warm up period by resolving a start date that would send that amount of data into the algorithm. The highest (smallest) resolution in the securities collection will be used. For example, if an algorithm has minute and daily data and 200 bars are requested, that would use 200 minute bars.

Parameters
barCountThe number of data points requested for warm up

Definition at line 112 of file QCAlgorithm.History.cs.

◆ SetWarmup() [4/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmup ( int  barCount,
Resolution resolution 
)

Sets the warm up period by resolving a start date that would send that amount of data into the algorithm.

Parameters
barCountThe number of data points requested for warm up
resolutionThe resolution to request

Definition at line 123 of file QCAlgorithm.History.cs.

◆ SetWarmUp() [4/4]

void QuantConnect.Algorithm.QCAlgorithm.SetWarmUp ( int  barCount,
Resolution resolution 
)

Sets the warm up period by resolving a start date that would send that amount of data into the algorithm.

Parameters
barCountThe number of data points requested for warm up
resolutionThe resolution to request

Definition at line 141 of file QCAlgorithm.History.cs.

◆ SetFinishedWarmingUp()

void QuantConnect.Algorithm.QCAlgorithm.SetFinishedWarmingUp ( )

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

Definition at line 149 of file QCAlgorithm.History.cs.

◆ GetWarmupHistoryRequests()

IEnumerable<HistoryRequest> QuantConnect.Algorithm.QCAlgorithm.GetWarmupHistoryRequests ( )

Gets the history requests required for provide warm up data for the algorithm

Returns

Definition at line 168 of file QCAlgorithm.History.cs.

◆ History() [1/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( TimeSpan  span,
Resolution resolution = null 
)

Get the history for all configured securities over the requested span. This will use the resolution and other subscription settings for each security. The symbols must exist in the Securities collection.

Parameters
spanThe span over which to request data. This is a calendar span, so take into consideration weekends and such
resolutionThe resolution to request
Returns
An enumerable of slice containing data over the most recent span for all configured securities

Definition at line 192 of file QCAlgorithm.History.cs.

◆ History() [2/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( int  periods,
Resolution resolution = null 
)

Get the history for all configured securities over the requested span. This will use the resolution and other subscription settings for each security. The symbols must exist in the Securities collection.

Parameters
periodsThe number of bars to request
resolutionThe resolution to request
Returns
An enumerable of slice containing data over the most recent span for all configured securities

Definition at line 205 of file QCAlgorithm.History.cs.

◆ History< T >() [1/7]

IEnumerable<DataDictionary<T> > QuantConnect.Algorithm.QCAlgorithm.History< T > ( TimeSpan  span,
Resolution resolution = null 
)

Gets the historical data for all symbols of the requested type over the requested span. The symbol's configured values for resolution and fill forward behavior will be used The symbols must exist in the Securities collection.

Parameters
spanThe span over which to retrieve recent historical data
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 218 of file QCAlgorithm.History.cs.

◆ History< T >() [2/7]

IEnumerable<DataDictionary<T> > QuantConnect.Algorithm.QCAlgorithm.History< T > ( IEnumerable< Symbol symbols,
TimeSpan  span,
Resolution resolution = null 
)

Gets the historical data for the specified symbols over the requested span. The symbols must exist in the Securities collection.

Template Parameters
TThe data type of the symbols
Parameters
symbolsThe symbols to retrieve historical data for
spanThe span over which to retrieve recent historical data
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 233 of file QCAlgorithm.History.cs.

◆ History< T >() [3/7]

IEnumerable<DataDictionary<T> > QuantConnect.Algorithm.QCAlgorithm.History< T > ( IEnumerable< Symbol symbols,
int  periods,
Resolution resolution = null 
)

Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection.

Template Parameters
TThe data type of the symbols
Parameters
symbolsThe symbols to retrieve historical data for
periodsThe number of bars to request
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 249 of file QCAlgorithm.History.cs.

◆ History< T >() [4/7]

IEnumerable<DataDictionary<T> > QuantConnect.Algorithm.QCAlgorithm.History< T > ( IEnumerable< Symbol symbols,
DateTime  start,
DateTime  end,
Resolution resolution = null 
)

Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.

Template Parameters
TThe data type of the symbols
Parameters
symbolsThe symbols to retrieve historical data for
startThe start time in the algorithm's time zone
endThe end time in the algorithm's time zone
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 275 of file QCAlgorithm.History.cs.

◆ History< T >() [5/7]

IEnumerable<T> QuantConnect.Algorithm.QCAlgorithm.History< T > ( Symbol  symbol,
TimeSpan  span,
Resolution resolution = null 
)

Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.

Template Parameters
TThe data type of the symbol
Parameters
symbolThe symbol to retrieve historical data for
spanThe span over which to retrieve recent historical data
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 297 of file QCAlgorithm.History.cs.

◆ History() [3/19]

IEnumerable<TradeBar> QuantConnect.Algorithm.QCAlgorithm.History ( Symbol  symbol,
int  periods,
Resolution resolution = null 
)

Gets the historical data for the specified symbol. The exact number of bars will be returned. The symbol must exist in the Securities collection.

Parameters
symbolThe symbol to retrieve historical data for
periodsThe number of bars to request
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data

Definition at line 311 of file QCAlgorithm.History.cs.

◆ History< T >() [6/7]

IEnumerable<T> QuantConnect.Algorithm.QCAlgorithm.History< T > ( Symbol  symbol,
int  periods,
Resolution resolution = null 
)

Gets the historical data for the specified symbol. The exact number of bars will be returned. The symbol must exist in the Securities collection.

Template Parameters
TThe data type of the symbol
Parameters
symbolThe symbol to retrieve historical data for
periodsThe number of bars to request
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 331 of file QCAlgorithm.History.cs.

◆ History< T >() [7/7]

IEnumerable<T> QuantConnect.Algorithm.QCAlgorithm.History< T > ( Symbol  symbol,
DateTime  start,
DateTime  end,
Resolution resolution = null 
)

Gets the historical data for the specified symbol between the specified dates. The symbol must exist in the Securities collection.

Parameters
symbolThe symbol to retrieve historical data for
startThe start time in the algorithm's time zone
endThe end time in the algorithm's time zone
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data
Type Constraints
T :IBaseData 

Definition at line 350 of file QCAlgorithm.History.cs.

◆ History() [4/19]

IEnumerable<TradeBar> QuantConnect.Algorithm.QCAlgorithm.History ( Symbol  symbol,
TimeSpan  span,
Resolution resolution = null 
)

Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.

Parameters
symbolThe symbol to retrieve historical data for
spanThe span over which to retrieve recent historical data
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data

Definition at line 366 of file QCAlgorithm.History.cs.

◆ History() [5/19]

IEnumerable<TradeBar> QuantConnect.Algorithm.QCAlgorithm.History ( Symbol  symbol,
DateTime  start,
DateTime  end,
Resolution resolution = null 
)

Gets the historical data for the specified symbol over the request span. The symbol must exist in the Securities collection.

Parameters
symbolThe symbol to retrieve historical data for
startThe start time in the algorithm's time zone
endThe end time in the algorithm's time zone
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data

Definition at line 379 of file QCAlgorithm.History.cs.

◆ History() [6/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( IEnumerable< Symbol symbols,
TimeSpan  span,
Resolution resolution = null 
)

Gets the historical data for the specified symbols over the requested span. The symbol's configured values for resolution and fill forward behavior will be used The symbols must exist in the Securities collection.

Parameters
symbolsThe symbols to retrieve historical data for
spanThe span over which to retrieve recent historical data
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data

Definition at line 406 of file QCAlgorithm.History.cs.

◆ History() [7/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( IEnumerable< Symbol symbols,
int  periods,
Resolution resolution = null 
)

Gets the historical data for the specified symbols. The exact number of bars will be returned for each symbol. This may result in some data start earlier/later than others due to when various exchanges are open. The symbols must exist in the Securities collection.

Parameters
symbolsThe symbols to retrieve historical data for
periodsThe number of bars to request
resolutionThe resolution to request
Returns
An enumerable of slice containing the requested historical data

Definition at line 420 of file QCAlgorithm.History.cs.

◆ History() [8/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( IEnumerable< Symbol symbols,
DateTime  start,
DateTime  end,
Resolution resolution = null,
bool?  fillForward = null,
bool?  extendedMarket = null 
)

Gets the historical data for the specified symbols between the specified dates. The symbols must exist in the Securities collection.

Parameters
symbolsThe symbols to retrieve historical data for
startThe start time in the algorithm's time zone
endThe end time in the algorithm's time zone
resolutionThe resolution to request
fillForwardTrue to fill forward missing data, false otherwise
extendedMarketTrue to include extended market hours data, false otherwise
Returns
An enumerable of slice containing the requested historical data

Definition at line 436 of file QCAlgorithm.History.cs.

◆ History() [9/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( HistoryRequest  request)

Executes the specified history request

Parameters
requestthe history request to execute
Returns
An enumerable of slice satisfying the specified history request

Definition at line 446 of file QCAlgorithm.History.cs.

◆ History() [10/19]

IEnumerable<Slice> QuantConnect.Algorithm.QCAlgorithm.History ( IEnumerable< HistoryRequest requests)

Executes the specified history requests

Parameters
requeststhe history requests to execute
Returns
An enumerable of slice satisfying the specified history request

Definition at line 456 of file QCAlgorithm.History.cs.

◆ GetLastKnownPrices() [1/2]

IEnumerable<BaseData> QuantConnect.Algorithm.QCAlgorithm.GetLastKnownPrices ( Security  security)

Yields data to warmup a security for all it's subscribed data types

Parameters
securitySecurity object for which to retrieve historical data
Returns
Securities historical data

Definition at line 466 of file QCAlgorithm.History.cs.

◆ GetLastKnownPrices() [2/2]

IEnumerable<BaseData> QuantConnect.Algorithm.QCAlgorithm.GetLastKnownPrices ( Symbol  symbol)

Yields data to warmup a security for all it's subscribed data types

Parameters
symbolThe symbol we want to get seed data for
Returns
Securities historical data

Definition at line 476 of file QCAlgorithm.History.cs.

◆ GetLastKnownPrice()

BaseData QuantConnect.Algorithm.QCAlgorithm.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

Definition at line 537 of file QCAlgorithm.History.cs.

◆ ABANDS()

AccelerationBands QuantConnect.Algorithm.QCAlgorithm.ABANDS ( Symbol  symbol,
int  period,
decimal  width = 4,
MovingAverageType  movingAverageType = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new Acceleration Bands indicator.

Parameters
symbolThe symbol whose Acceleration Bands we want.
periodThe period of the three moving average (middle, upper and lower band).
widthA coefficient specifying the distance between the middle band and upper or lower bands.
movingAverageTypeType of the moving average.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.
Returns

Definition at line 45 of file QCAlgorithm.Indicators.cs.

◆ AD()

AccumulationDistribution QuantConnect.Algorithm.QCAlgorithm.AD ( Symbol  symbol,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new AccumulationDistribution indicator.

Parameters
symbolThe symbol whose AD we want
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The AccumulationDistribution indicator for the requested symbol over the speified period

Definition at line 67 of file QCAlgorithm.Indicators.cs.

◆ ADOSC()

AccumulationDistributionOscillator QuantConnect.Algorithm.QCAlgorithm.ADOSC ( Symbol  symbol,
int  fastPeriod,
int  slowPeriod,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new AccumulationDistributionOscillator indicator.

Parameters
symbolThe symbol whose ADOSC we want
fastPeriodThe fast moving average period
slowPeriodThe slow moving average period
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The AccumulationDistributionOscillator indicator for the requested symbol over the speified period

Definition at line 90 of file QCAlgorithm.Indicators.cs.

◆ ARIMA()

AutoRegressiveIntegratedMovingAverage QuantConnect.Algorithm.QCAlgorithm.ARIMA ( Symbol  symbol,
int  arOrder,
int  diffOrder,
int  maOrder,
int  period,
Resolution resolution = null 
)

Creates a new ARIMA indicator.

Parameters
symbolThe symbol whose ARIMA indicator we want
arOrderAR order (p) – defines the number of past values to consider in the AR component of the model.
diffOrderDifference order (d) – defines how many times to difference the model before fitting parameters.
maOrderMA order (q) – defines the number of past values to consider in the MA component of the model.
periodSize of the rolling series to fit onto
resolutionThe resolution
Returns
The ARIMA indicator for the requested symbol over the specified period

Definition at line 114 of file QCAlgorithm.Indicators.cs.

◆ ADX()

AverageDirectionalIndex QuantConnect.Algorithm.QCAlgorithm.ADX ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Average Directional Index indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Average Directional Index we seek
resolutionThe resolution.
periodThe period over which to compute the Average Directional Index
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Average Directional Index indicator for the requested symbol.

Definition at line 137 of file QCAlgorithm.Indicators.cs.

◆ AO()

AwesomeOscillator QuantConnect.Algorithm.QCAlgorithm.AO ( Symbol  symbol,
int  slowPeriod,
int  fastPeriod,
MovingAverageType  type,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Awesome Oscillator from the specified periods.

Parameters
symbolThe symbol whose Awesome Oscillator we seek
resolutionThe resolution.
fastPeriodThe period of the fast moving average associated with the AO
slowPeriodThe period of the slow moving average associated with the AO
typeThe type of moving average used when computing the fast and slow term. Defaults to simple moving average.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar

Definition at line 160 of file QCAlgorithm.Indicators.cs.

◆ ADXR()

AverageDirectionalMovementIndexRating QuantConnect.Algorithm.QCAlgorithm.ADXR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new AverageDirectionalMovementIndexRating indicator.

Parameters
symbolThe symbol whose ADXR we want
periodThe period over which to compute the ADXR
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The AverageDirectionalMovementIndexRating indicator for the requested symbol over the specified period

Definition at line 182 of file QCAlgorithm.Indicators.cs.

◆ ALMA()

ArnaudLegouxMovingAverage QuantConnect.Algorithm.QCAlgorithm.ALMA ( Symbol  symbol,
int  period,
int  sigma = 6,
decimal  offset = 0.85m,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new ArnaudLegouxMovingAverage indicator.

Parameters
symbolThe symbol whose ALMA we want
periodint - the number of periods to calculate the ALMA
sigmaint - this parameter is responsible for the shape of the curve coefficients.
offsetdecimal - This parameter allows regulating the smoothness and high sensitivity of the Moving Average. The range for this parameter is [0, 1].
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The ArnaudLegouxMovingAverage indicator for the requested symbol over the specified period

Definition at line 210 of file QCAlgorithm.Indicators.cs.

◆ APO()

AbsolutePriceOscillator QuantConnect.Algorithm.QCAlgorithm.APO ( Symbol  symbol,
int  fastPeriod,
int  slowPeriod,
MovingAverageType  movingAverageType,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new AbsolutePriceOscillator indicator.

Parameters
symbolThe symbol whose APO we want
fastPeriodThe fast moving average period
slowPeriodThe slow moving average period
movingAverageTypeThe type of moving average to use
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The AbsolutePriceOscillator indicator for the requested symbol over the specified period

Definition at line 234 of file QCAlgorithm.Indicators.cs.

◆ AROON() [1/2]

AroonOscillator QuantConnect.Algorithm.QCAlgorithm.AROON ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)

Parameters
symbolThe symbol whose Aroon we seek
periodThe look back period for computing number of periods since maximum and minimum
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
An AroonOscillator configured with the specied periods

Definition at line 256 of file QCAlgorithm.Indicators.cs.

◆ AROON() [2/2]

AroonOscillator QuantConnect.Algorithm.QCAlgorithm.AROON ( Symbol  symbol,
int  upPeriod,
int  downPeriod,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)

Parameters
symbolThe symbol whose Aroon we seek
upPeriodThe look back period for computing number of periods since maximum
downPeriodThe look back period for computing number of periods since minimum
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
An AroonOscillator configured with the specified periods

Definition at line 270 of file QCAlgorithm.Indicators.cs.

◆ ATR()

AverageTrueRange QuantConnect.Algorithm.QCAlgorithm.ATR ( Symbol  symbol,
int  period,
MovingAverageType  type = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new AverageTrueRange indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose ATR we want
periodThe smoothing period used to smooth the computed TrueRange values
typeThe type of smoothing to use
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
A new AverageTrueRange indicator with the specified smoothing type and period

Definition at line 294 of file QCAlgorithm.Indicators.cs.

◆ APS()

AugenPriceSpike QuantConnect.Algorithm.QCAlgorithm.APS ( Symbol  symbol,
int  period = 3,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates an AugenPriceSpike indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose APS we want
periodThe period of the APS
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The AugenPriceSpike indicator for the given parameters

Definition at line 317 of file QCAlgorithm.Indicators.cs.

◆ BB()

BollingerBands QuantConnect.Algorithm.QCAlgorithm.BB ( Symbol  symbol,
int  period,
decimal  k,
MovingAverageType  movingAverageType = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation

Parameters
symbolThe symbol whose BollingerBands we seek
periodThe period of the standard deviation and moving average (middle band)
kThe number of standard deviations specifying the distance between the middle band and upper or lower bands
movingAverageTypeThe type of moving average to be used
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
A BollingerBands configured with the specified period

Definition at line 341 of file QCAlgorithm.Indicators.cs.

◆ BOP()

BalanceOfPower QuantConnect.Algorithm.QCAlgorithm.BOP ( Symbol  symbol,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Balance Of Power indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Balance Of Power we seek
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Balance Of Power indicator for the requested symbol.

Definition at line 363 of file QCAlgorithm.Indicators.cs.

◆ CC()

CoppockCurve QuantConnect.Algorithm.QCAlgorithm.CC ( Symbol  symbol,
int  shortRocPeriod = 11,
int  longRocPeriod = 14,
int  lwmaPeriod = 10,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Initializes a new instance of the CoppockCurve indicator

Parameters
symbolThe symbol whose Coppock Curve we want
shortRocPeriodThe period for the short ROC
longRocPeriodThe period for the long ROC
lwmaPeriodThe period for the LWMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Coppock Curve indicator for the requested symbol over the specified period

Definition at line 387 of file QCAlgorithm.Indicators.cs.

◆ CCI()

CommodityChannelIndex QuantConnect.Algorithm.QCAlgorithm.CCI ( Symbol  symbol,
int  period,
MovingAverageType  movingAverageType = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new CommodityChannelIndex indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose CCI we want
periodThe period over which to compute the CCI
movingAverageTypeThe type of moving average to use in computing the typical price average
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The CommodityChannelIndex indicator for the requested symbol over the specified period

Definition at line 412 of file QCAlgorithm.Indicators.cs.

◆ CMF()

ChaikinMoneyFlow QuantConnect.Algorithm.QCAlgorithm.CMF ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new ChaikinMoneyFlow indicator.

Parameters
symbolThe symbol whose CMF we want
periodThe period over which to compute the CMF
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The ChaikinMoneyFlow indicator for the requested symbol over the specified period

Definition at line 434 of file QCAlgorithm.Indicators.cs.

◆ DCH() [1/2]

DonchianChannel QuantConnect.Algorithm.QCAlgorithm.DCH ( Symbol  symbol,
int  upperPeriod,
int  lowerPeriod,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Donchian Channel indicator which will compute the Upper Band and Lower Band. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Donchian Channel we seek.
upperPeriodThe period over which to compute the upper Donchian Channel.
lowerPeriodThe period over which to compute the lower Donchian Channel.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Donchian Channel indicator for the requested symbol.

Definition at line 504 of file QCAlgorithm.Indicators.cs.

◆ DCH() [2/2]

DonchianChannel QuantConnect.Algorithm.QCAlgorithm.DCH ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Overload shorthand to create a new symmetric Donchian Channel indicator which has the upper and lower channels set to the same period length.

Parameters
symbolThe symbol whose Donchian Channel we seek.
periodThe period over which to compute the Donchian Channel.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Donchian Channel indicator for the requested symbol.

Definition at line 527 of file QCAlgorithm.Indicators.cs.

◆ DEMA()

DoubleExponentialMovingAverage QuantConnect.Algorithm.QCAlgorithm.DEMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new DoubleExponentialMovingAverage indicator.

Parameters
symbolThe symbol whose DEMA we want
periodThe period over which to compute the DEMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The DoubleExponentialMovingAverage indicator for the requested symbol over the specified period

Definition at line 540 of file QCAlgorithm.Indicators.cs.

◆ DPO()

DetrendedPriceOscillator QuantConnect.Algorithm.QCAlgorithm.DPO ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new DetrendedPriceOscillator indicator.

Parameters
symbolThe symbol whose DPO we want
periodThe period over which to compute the DPO
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
A new registered DetrendedPriceOscillator indicator for the requested symbol over the specified period

Definition at line 562 of file QCAlgorithm.Indicators.cs.

◆ EMA() [1/2]

ExponentialMovingAverage QuantConnect.Algorithm.QCAlgorithm.EMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose EMA we want
periodThe period of the EMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The ExponentialMovingAverage for the given parameters

Definition at line 585 of file QCAlgorithm.Indicators.cs.

◆ EMA() [2/2]

ExponentialMovingAverage QuantConnect.Algorithm.QCAlgorithm.EMA ( Symbol  symbol,
int  period,
decimal  smoothingFactor,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose EMA we want
periodThe period of the EMA
smoothingFactorThe percentage of data from the previous value to be carried into the next value
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The ExponentialMovingAverage for the given parameters

Definition at line 600 of file QCAlgorithm.Indicators.cs.

◆ EMV()

EaseOfMovementValue QuantConnect.Algorithm.QCAlgorithm.EMV ( Symbol  symbol,
int  period = 1,
int  scale = 10000,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose EMV we want
periodThe period of the EMV
scaleThe length of the outputed value
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The EaseOfMovementValue indicator for the given parameters

Definition at line 624 of file QCAlgorithm.Indicators.cs.

◆ FilteredIdentity() [1/6]

FilteredIdentity QuantConnect.Algorithm.QCAlgorithm.FilteredIdentity ( Symbol  symbol,
Func< IBaseData, IBaseDataBar selector = null,
Func< IBaseData, bool >  filter = null,
string  fieldName = null 
)

Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
filterFilters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter
fieldNameThe name of the field being selected
Returns
A new FilteredIdentity indicator for the specified symbol and selector

Definition at line 647 of file QCAlgorithm.Indicators.cs.

◆ FilteredIdentity() [2/6]

FilteredIdentity QuantConnect.Algorithm.QCAlgorithm.FilteredIdentity ( Symbol  symbol,
Resolution  resolution,
Func< IBaseData, IBaseDataBar selector = null,
Func< IBaseData, bool >  filter = null,
string  fieldName = null 
)

Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
resolutionThe desired resolution of the data
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
filterFilters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter
fieldNameThe name of the field being selected
Returns
A new FilteredIdentity indicator for the specified symbol and selector

Definition at line 663 of file QCAlgorithm.Indicators.cs.

◆ FilteredIdentity() [3/6]

FilteredIdentity QuantConnect.Algorithm.QCAlgorithm.FilteredIdentity ( Symbol  symbol,
TimeSpan  resolution,
Func< IBaseData, IBaseDataBar selector = null,
Func< IBaseData, bool >  filter = null,
string  fieldName = null 
)

Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
resolutionThe desired resolution of the data
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
filterFilters the IBaseData send into the indicator, if null defaults to true (x => true) which means no filter
fieldNameThe name of the field being selected
Returns
A new FilteredIdentity indicator for the specified symbol and selector

Definition at line 681 of file QCAlgorithm.Indicators.cs.

◆ FISH()

FisherTransform QuantConnect.Algorithm.QCAlgorithm.FISH ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates an FisherTransform indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose FisherTransform we want
periodThe period of the FisherTransform
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The FisherTransform for the given parameters

Definition at line 698 of file QCAlgorithm.Indicators.cs.

◆ FRAMA()

FractalAdaptiveMovingAverage QuantConnect.Algorithm.QCAlgorithm.FRAMA ( Symbol  symbol,
int  period,
int  longPeriod = 198,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates an FractalAdaptiveMovingAverage (FRAMA) indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose FRAMA we want
periodThe period of the FRAMA
longPeriodThe long period of the FRAMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The FRAMA for the given parameters

Definition at line 722 of file QCAlgorithm.Indicators.cs.

◆ HeikinAshi()

HeikinAshi QuantConnect.Algorithm.QCAlgorithm.HeikinAshi ( Symbol  symbol,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new Heikin-Ashi indicator.

Parameters
symbolThe symbol whose Heikin-Ashi we want
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Heikin-Ashi indicator for the requested symbol over the specified period

Definition at line 743 of file QCAlgorithm.Indicators.cs.

◆ HMA()

HullMovingAverage QuantConnect.Algorithm.QCAlgorithm.HMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new HullMovingAverage indicator. The Hull moving average is a series of nested weighted moving averages, is fast and smooth.

Parameters
symbolThe symbol whose Hull moving average we want
periodThe period over which to compute the Hull moving average
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns

Definition at line 765 of file QCAlgorithm.Indicators.cs.

◆ ICHIMOKU()

IchimokuKinkoHyo QuantConnect.Algorithm.QCAlgorithm.ICHIMOKU ( Symbol  symbol,
int  tenkanPeriod,
int  kijunPeriod,
int  senkouAPeriod,
int  senkouBPeriod,
int  senkouADelayPeriod,
int  senkouBDelayPeriod,
Resolution resolution = null 
)

Creates a new IchimokuKinkoHyo indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose ICHIMOKU we want
tenkanPeriodThe period to calculate the Tenkan-sen period
kijunPeriodThe period to calculate the Kijun-sen period
senkouAPeriodThe period to calculate the Tenkan-sen period
senkouBPeriodThe period to calculate the Tenkan-sen period
senkouADelayPeriodThe period to calculate the Tenkan-sen period
senkouBDelayPeriodThe period to calculate the Tenkan-sen period
resolutionThe resolution
Returns
A new IchimokuKinkoHyo indicator with the specified periods and delays

Definition at line 792 of file QCAlgorithm.Indicators.cs.

◆ Identity() [1/3]

Identity QuantConnect.Algorithm.QCAlgorithm.Identity ( Symbol  symbol,
Func< IBaseData, decimal >  selector = null,
string  fieldName = null 
)

Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
fieldNameThe name of the field being selected
Returns
A new Identity indicator for the specified symbol and selector

Definition at line 814 of file QCAlgorithm.Indicators.cs.

◆ Identity() [2/3]

Identity QuantConnect.Algorithm.QCAlgorithm.Identity ( Symbol  symbol,
Resolution  resolution,
Func< IBaseData, decimal >  selector = null,
string  fieldName = null 
)

Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
resolutionThe desired resolution of the data
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
fieldNameThe name of the field being selected
Returns
A new Identity indicator for the specified symbol and selector

Definition at line 829 of file QCAlgorithm.Indicators.cs.

◆ Identity() [3/3]

Identity QuantConnect.Algorithm.QCAlgorithm.Identity ( Symbol  symbol,
TimeSpan  resolution,
Func< IBaseData, decimal >  selector = null,
string  fieldName = null 
)

Creates a new Identity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution

Parameters
symbolThe symbol whose values we want as an indicator
resolutionThe desired resolution of the data
selectorSelects a value from the BaseData, if null defaults to the .Value property (x => x.Value)
fieldNameThe name of the field being selected
Returns
A new Identity indicator for the specified symbol and selector

Definition at line 846 of file QCAlgorithm.Indicators.cs.

◆ KAMA() [1/2]

KaufmanAdaptiveMovingAverage QuantConnect.Algorithm.QCAlgorithm.KAMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new KaufmanAdaptiveMovingAverage indicator.

Parameters
symbolThe symbol whose KAMA we want
periodThe period of the Efficiency Ratio (ER) of KAMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The KaufmanAdaptiveMovingAverage indicator for the requested symbol over the specified period

Definition at line 862 of file QCAlgorithm.Indicators.cs.

◆ KAMA() [2/2]

KaufmanAdaptiveMovingAverage QuantConnect.Algorithm.QCAlgorithm.KAMA ( Symbol  symbol,
int  period,
int  fastEmaPeriod,
int  slowEmaPeriod,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new KaufmanAdaptiveMovingAverage indicator.

Parameters
symbolThe symbol whose KAMA we want
periodThe period of the Efficiency Ratio (ER)
fastEmaPeriodThe period of the fast EMA used to calculate the Smoothing Constant (SC)
slowEmaPeriodThe period of the slow EMA used to calculate the Smoothing Constant (SC)
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The KaufmanAdaptiveMovingAverage indicator for the requested symbol over the specified period

Definition at line 877 of file QCAlgorithm.Indicators.cs.

◆ KCH()

KeltnerChannels QuantConnect.Algorithm.QCAlgorithm.KCH ( Symbol  symbol,
int  period,
decimal  k,
MovingAverageType  movingAverageType = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Keltner Channels indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Keltner Channel we seek
periodThe period over which to compute the Keltner Channels
kThe number of multiples of the AverageTrueRange from the middle band of the Keltner Channels
movingAverageTypeSpecifies the type of moving average to be used as the middle line of the Keltner Channel
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The Keltner Channel indicator for the requested symbol.

Definition at line 902 of file QCAlgorithm.Indicators.cs.

◆ LOGR()

LogReturn QuantConnect.Algorithm.QCAlgorithm.LOGR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new LogReturn indicator.

Parameters
symbolThe symbol whose log return we seek
periodThe period of the log return.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.
Returns
log return indicator for the requested symbol.

Definition at line 924 of file QCAlgorithm.Indicators.cs.

◆ LSMA()

LeastSquaresMovingAverage QuantConnect.Algorithm.QCAlgorithm.LSMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates and registers a new Least Squares Moving Average instance.

Parameters
symbolThe symbol whose LSMA we seek.
periodThe LSMA period. Normally 14.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.
Returns
A LeastSquaredMovingAverage configured with the specified period

Definition at line 946 of file QCAlgorithm.Indicators.cs.

◆ LWMA()

LinearWeightedMovingAverage QuantConnect.Algorithm.QCAlgorithm.LWMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new LinearWeightedMovingAverage indicator. This indicator will linearly distribute the weights across the periods.

Parameters
symbolThe symbol whose LWMA we want
periodThe period over which to compute the LWMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns

Definition at line 969 of file QCAlgorithm.Indicators.cs.

◆ MACD()

MovingAverageConvergenceDivergence QuantConnect.Algorithm.QCAlgorithm.MACD ( Symbol  symbol,
int  fastPeriod,
int  slowPeriod,
int  signalPeriod,
MovingAverageType  type = MovingAverageType.Exponential,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a MACD indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose MACD we want
fastPeriodThe period for the fast moving average
slowPeriodThe period for the slow moving average
signalPeriodThe period for the signal moving average
typeThe type of moving average to use for the MACD
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The moving average convergence divergence between the fast and slow averages

Definition at line 994 of file QCAlgorithm.Indicators.cs.

◆ MAD()

MeanAbsoluteDeviation QuantConnect.Algorithm.QCAlgorithm.MAD ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new MeanAbsoluteDeviation indicator.

Parameters
symbolThe symbol whose MeanAbsoluteDeviation we want
periodThe period over which to compute the MeanAbsoluteDeviation
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The MeanAbsoluteDeviation indicator for the requested symbol over the specified period

Definition at line 1016 of file QCAlgorithm.Indicators.cs.

◆ VP()

VolumeProfile QuantConnect.Algorithm.QCAlgorithm.VP ( Symbol  symbol,
int  period = 2,
decimal  valueAreaVolumePercentage = 0.70m,
decimal  priceRangeRoundOff = 0.05m,
Resolution  resolution = Resolution.Daily,
Func< IBaseData, TradeBar selector = null 
)

Creates an Market Profile indicator for the symbol with Volume Profile (VOL) mode. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose VP we want
periodThe period of the VP
valueAreaVolumePercentageThe percentage of volume contained in the value area
priceRangeRoundOffHow many digits you want to round and the precision. i.e 0.01 round to two digits exactly.
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Volume Profile indicator for the given parameters

Definition at line 1041 of file QCAlgorithm.Indicators.cs.

◆ TP()

TimeProfile QuantConnect.Algorithm.QCAlgorithm.TP ( Symbol  symbol,
int  period = 2,
decimal  valueAreaVolumePercentage = 0.70m,
decimal  priceRangeRoundOff = 0.05m,
Resolution  resolution = Resolution.Daily,
Func< IBaseData, TradeBar selector = null 
)

Creates an Market Profile indicator for the symbol with Time Price Opportunity (TPO) mode. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose TP we want
periodThe period of the TP
valueAreaVolumePercentageThe percentage of volume contained in the value area
priceRangeRoundOffHow many digits you want to round and the precision. i.e 0.01 round to two digits exactly.
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Time Profile indicator for the given parameters

Definition at line 1066 of file QCAlgorithm.Indicators.cs.

◆ MAX()

Maximum QuantConnect.Algorithm.QCAlgorithm.MAX ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Maximum indicator to compute the maximum value

Parameters
symbolThe symbol whose max we want
periodThe look back period over which to compute the max value
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null and the symbol is of type TradeBar defaults to the High property, otherwise it defaults to Value property of BaseData (x => x.Value)
Returns
A Maximum indicator that compute the max value and the periods since the max value

Definition at line 1089 of file QCAlgorithm.Indicators.cs.

◆ MFI()

MoneyFlowIndex QuantConnect.Algorithm.QCAlgorithm.MFI ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new MoneyFlowIndex indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose MFI we want
periodThe period over which to compute the MFI
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The MoneyFlowIndex indicator for the requested symbol over the specified period

Definition at line 1124 of file QCAlgorithm.Indicators.cs.

◆ MASS()

MassIndex QuantConnect.Algorithm.QCAlgorithm.MASS ( Symbol  symbol,
int  emaPeriod = 9,
int  sumPeriod = 25,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new Mass Index indicator. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Mass Index we want.
emaPeriodThe period used by both EMA.
sumPeriodThe sum period.
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Mass Index indicator for the requested symbol over the specified period

Definition at line 1148 of file QCAlgorithm.Indicators.cs.

◆ MIDPOINT()

MidPoint QuantConnect.Algorithm.QCAlgorithm.MIDPOINT ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new MidPoint indicator.

Parameters
symbolThe symbol whose MIDPOINT we want
periodThe period over which to compute the MIDPOINT
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The MidPoint indicator for the requested symbol over the specified period

Definition at line 1170 of file QCAlgorithm.Indicators.cs.

◆ MIDPRICE()

MidPrice QuantConnect.Algorithm.QCAlgorithm.MIDPRICE ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new MidPrice indicator.

Parameters
symbolThe symbol whose MIDPRICE we want
periodThe period over which to compute the MIDPRICE
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The MidPrice indicator for the requested symbol over the specified period

Definition at line 1192 of file QCAlgorithm.Indicators.cs.

◆ MIN()

Minimum QuantConnect.Algorithm.QCAlgorithm.MIN ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Minimum indicator to compute the minimum value

Parameters
symbolThe symbol whose min we want
periodThe look back period over which to compute the min value
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null and the symbol is of type TradeBar defaults to the Low property, otherwise it defaults to Value property of BaseData (x => x.Value)
Returns
A Minimum indicator that compute the in value and the periods since the min value

Definition at line 1215 of file QCAlgorithm.Indicators.cs.

◆ MOM()

Momentum QuantConnect.Algorithm.QCAlgorithm.MOM ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Momentum indicator. This will compute the absolute n-period change in the security. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose momentum we want
periodThe period over which to compute the momentum
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The momentum indicator for the requested symbol over the specified period

Definition at line 1250 of file QCAlgorithm.Indicators.cs.

◆ MOMERSION()

MomersionIndicator QuantConnect.Algorithm.QCAlgorithm.MOMERSION ( Symbol  symbol,
int?  minPeriod,
int  fullPeriod,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Momersion indicator.

Parameters
symbolThe symbol whose Momersion we want
minPeriodThe minimum period over which to compute the Momersion. Must be greater than 3. If null, only full period will be used in computations.
fullPeriodThe full period over which to compute the Momersion
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Momersion indicator for the requested symbol over the specified period

Definition at line 1273 of file QCAlgorithm.Indicators.cs.

◆ MOMP()

MomentumPercent QuantConnect.Algorithm.QCAlgorithm.MOMP ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new MomentumPercent indicator. This will compute the n-period percent change in the security. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose momentum we want
periodThe period over which to compute the momentum
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The momentum indicator for the requested symbol over the specified period

Definition at line 1296 of file QCAlgorithm.Indicators.cs.

◆ NATR()

NormalizedAverageTrueRange QuantConnect.Algorithm.QCAlgorithm.NATR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new NormalizedAverageTrueRange indicator.

Parameters
symbolThe symbol whose NATR we want
periodThe period over which to compute the NATR
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The NormalizedAverageTrueRange indicator for the requested symbol over the specified period

Definition at line 1318 of file QCAlgorithm.Indicators.cs.

◆ OBV()

OnBalanceVolume QuantConnect.Algorithm.QCAlgorithm.OBV ( Symbol  symbol,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new On Balance Volume indicator. This will compute the cumulative total volume based on whether the close price being higher or lower than the previous period. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose On Balance Volume we seek
resolutionThe resolution.
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
The On Balance Volume indicator for the requested symbol.

Definition at line 1341 of file QCAlgorithm.Indicators.cs.

◆ PPHL()

PivotPointsHighLow QuantConnect.Algorithm.QCAlgorithm.PPHL ( Symbol  symbol,
int  lengthHigh,
int  lengthLow,
int  lastStoredValues = 100,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new PivotPointsHighLow indicator

Parameters
symbolThe symbol whose PPHL we seek
lengthHighThe number of surrounding bars whose high values should be less than the current bar's for the bar high to be marked as high pivot point
lengthLowThe number of surrounding bars whose low values should be more than the current bar's for the bar low to be marked as low pivot point
lastStoredValuesThe number of last stored indicator values
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The PivotPointsHighLow indicator for the requested symbol.

Definition at line 1365 of file QCAlgorithm.Indicators.cs.

◆ PPO()

PercentagePriceOscillator QuantConnect.Algorithm.QCAlgorithm.PPO ( Symbol  symbol,
int  fastPeriod,
int  slowPeriod,
MovingAverageType  movingAverageType,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new PercentagePriceOscillator indicator.

Parameters
symbolThe symbol whose PPO we want
fastPeriodThe fast moving average period
slowPeriodThe slow moving average period
movingAverageTypeThe type of moving average to use
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The PercentagePriceOscillator indicator for the requested symbol over the specified period

Definition at line 1389 of file QCAlgorithm.Indicators.cs.

◆ PSAR()

ParabolicStopAndReverse QuantConnect.Algorithm.QCAlgorithm.PSAR ( Symbol  symbol,
decimal  afStart = 0.02m,
decimal  afIncrement = 0.02m,
decimal  afMax = 0.2m,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Parabolic SAR indicator

Parameters
symbolThe symbol whose PSAR we seek
afStartAcceleration factor start value. Normally 0.02
afIncrementAcceleration factor increment value. Normally 0.02
afMaxAcceleration factor max value. Normally 0.2
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
Returns
A ParabolicStopAndReverse configured with the specified periods

Definition at line 1413 of file QCAlgorithm.Indicators.cs.

◆ RC()

RegressionChannel QuantConnect.Algorithm.QCAlgorithm.RC ( Symbol  symbol,
int  period,
decimal  k,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RegressionChannel indicator which will compute the LinearRegression, UpperChannel and LowerChannel lines, the intercept and slope

Parameters
symbolThe symbol whose RegressionChannel we seek
periodThe period of the standard deviation and least square moving average (linear regression line)
kThe number of standard deviations specifying the distance between the linear regression and upper or lower channel lines
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
A Regression Channel configured with the specified period and number of standard deviation

Definition at line 1436 of file QCAlgorithm.Indicators.cs.

◆ ROC()

RateOfChange QuantConnect.Algorithm.QCAlgorithm.ROC ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RateOfChange indicator. This will compute the n-period rate of change in the security. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose RateOfChange we want
periodThe period over which to compute the RateOfChange
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RateOfChange indicator for the requested symbol over the specified period

Definition at line 1459 of file QCAlgorithm.Indicators.cs.

◆ ROCP()

RateOfChangePercent QuantConnect.Algorithm.QCAlgorithm.ROCP ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RateOfChangePercent indicator. This will compute the n-period percentage rate of change in the security. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose RateOfChangePercent we want
periodThe period over which to compute the RateOfChangePercent
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RateOfChangePercent indicator for the requested symbol over the specified period

Definition at line 1482 of file QCAlgorithm.Indicators.cs.

◆ ROCR()

RateOfChangeRatio QuantConnect.Algorithm.QCAlgorithm.ROCR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RateOfChangeRatio indicator.

Parameters
symbolThe symbol whose ROCR we want
periodThe period over which to compute the ROCR
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RateOfChangeRatio indicator for the requested symbol over the specified period

Definition at line 1504 of file QCAlgorithm.Indicators.cs.

◆ RSI()

RelativeStrengthIndex QuantConnect.Algorithm.QCAlgorithm.RSI ( Symbol  symbol,
int  period,
MovingAverageType  movingAverageType = MovingAverageType.Wilders,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RelativeStrengthIndex indicator. This will produce an oscillator that ranges from 0 to 100 based on the ratio of average gains to average losses over the specified period.

Parameters
symbolThe symbol whose RSI we want
periodThe period over which to compute the RSI
movingAverageTypeThe type of moving average to use in computing the average gain/loss values
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RelativeStrengthIndex indicator for the requested symbol over the specified period

Definition at line 1528 of file QCAlgorithm.Indicators.cs.

◆ RVI()

RelativeVigorIndex QuantConnect.Algorithm.QCAlgorithm.RVI ( Symbol  symbol,
int  period,
MovingAverageType  movingAverageType = MovingAverageType.Simple,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates a new RelativeVigorIndex indicator.

Parameters
symbolThe symbol whose RVI we want
periodThe period over which to compute the RVI
movingAverageTypeThe type of moving average to use
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RelativeVigorIndex indicator for the requested symbol over the specified period

Definition at line 1550 of file QCAlgorithm.Indicators.cs.

◆ RDV()

RelativeDailyVolume QuantConnect.Algorithm.QCAlgorithm.RDV ( Symbol  symbol,
int  period = 2,
Resolution  resolution = Resolution.Daily,
Func< IBaseData, TradeBar selector = null 
)

Creates an RelativeDailyVolume indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose RDV we want
periodThe period of the RDV
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Relative Volume indicator for the given parameters

Definition at line 1573 of file QCAlgorithm.Indicators.cs.

◆ SR()

SharpeRatio QuantConnect.Algorithm.QCAlgorithm.SR ( Symbol  symbol,
int  sharpePeriod,
decimal  riskFreeRate = 0.0m,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new RollingSharpeRatio indicator.

Parameters
symbolThe symbol whose RSR we want
sharpePeriodPeriod of historical observation for sharpe ratio calculation
riskFreeRateRisk-free rate for sharpe ratio calculation
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The RollingSharpeRatio indicator for the requested symbol over the specified period

Definition at line 1596 of file QCAlgorithm.Indicators.cs.

◆ SMA()

SimpleMovingAverage QuantConnect.Algorithm.QCAlgorithm.SMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates an SimpleMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose SMA we want
periodThe period of the SMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The SimpleMovingAverage for the given parameters

Definition at line 1620 of file QCAlgorithm.Indicators.cs.

◆ STC()

SchaffTrendCycle QuantConnect.Algorithm.QCAlgorithm.STC ( Symbol  symbol,
int  cyclePeriod,
int  fastPeriod,
int  slowPeriod,
MovingAverageType  movingAverageType = MovingAverageType.Exponential,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Schaff Trend Cycle indicator

Parameters
symbolThe symbol for the indicator to track
fastPeriodThe fast moving average period
slowPeriodThe slow moving average period
cyclePeriodThe signal period
movingAverageTypeThe type of moving average to use
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The SchaffTrendCycle indicator for the requested symbol over the specified period

Definition at line 1645 of file QCAlgorithm.Indicators.cs.

◆ STD()

StandardDeviation QuantConnect.Algorithm.QCAlgorithm.STD ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new StandardDeviation indicator. This will return the population standard deviation of samples over the specified period.

Parameters
symbolThe symbol whose STD we want
periodThe period over which to compute the STD
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The StandardDeviation indicator for the requested symbol over the specified period

Definition at line 1667 of file QCAlgorithm.Indicators.cs.

◆ STO() [1/2]

Stochastic QuantConnect.Algorithm.QCAlgorithm.STO ( Symbol  symbol,
int  period,
int  kPeriod,
int  dPeriod,
Resolution resolution = null 
)

Creates a new Stochastic indicator.

Parameters
symbolThe symbol whose stochastic we seek
resolutionThe resolution.
periodThe period of the stochastic. Normally 14
kPeriodThe sum period of the stochastic. Normally 14
dPeriodThe sum period of the stochastic. Normally 3
Returns
Stochastic indicator for the requested symbol.

Definition at line 1689 of file QCAlgorithm.Indicators.cs.

◆ STO() [2/2]

Stochastic QuantConnect.Algorithm.QCAlgorithm.STO ( Symbol  symbol,
int  period,
Resolution resolution = null 
)

Overload short hand to create a new Stochastic indicator; defaulting to the 3 period for dStoch

Parameters
symbolThe symbol whose stochastic we seek
resolutionThe resolution.
periodThe period of the stochastic. Normally 14
Returns
Stochastic indicator for the requested symbol.

Definition at line 1710 of file QCAlgorithm.Indicators.cs.

◆ SUM()

Sum QuantConnect.Algorithm.QCAlgorithm.SUM ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Sum indicator.

Parameters
symbolThe symbol whose Sum we want
periodThe period over which to compute the Sum
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Sum indicator for the requested symbol over the specified period

Definition at line 1723 of file QCAlgorithm.Indicators.cs.

◆ SWISS()

SwissArmyKnife QuantConnect.Algorithm.QCAlgorithm.SWISS ( Symbol  symbol,
int  period,
double  delta,
SwissArmyKnifeTool  tool,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates Swiss Army Knife transformation for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol to use for calculations
periodThe period of the calculation
deltaThe delta scale of the BandStop or BandPass
toolThe tool os the Swiss Army Knife
resolutionThe resolution
selectorelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The calculation using the given tool

Definition at line 1748 of file QCAlgorithm.Indicators.cs.

◆ T3()

T3MovingAverage QuantConnect.Algorithm.QCAlgorithm.T3 ( Symbol  symbol,
int  period,
decimal  volumeFactor = 0.7m,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new T3MovingAverage indicator.

Parameters
symbolThe symbol whose T3 we want
periodThe period over which to compute the T3
volumeFactorThe volume factor to be used for the T3 (value must be in the [0,1] range, defaults to 0.7)
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The T3MovingAverage indicator for the requested symbol over the specified period

Definition at line 1771 of file QCAlgorithm.Indicators.cs.

◆ TEMA()

TripleExponentialMovingAverage QuantConnect.Algorithm.QCAlgorithm.TEMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new TripleExponentialMovingAverage indicator.

Parameters
symbolThe symbol whose TEMA we want
periodThe period over which to compute the TEMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The TripleExponentialMovingAverage indicator for the requested symbol over the specified period

Definition at line 1793 of file QCAlgorithm.Indicators.cs.

◆ TR()

TrueRange QuantConnect.Algorithm.QCAlgorithm.TR ( Symbol  symbol,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new TrueRange indicator.

Parameters
symbolThe symbol whose TR we want
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The TrueRange indicator for the requested symbol.

Definition at line 1814 of file QCAlgorithm.Indicators.cs.

◆ TRIMA()

TriangularMovingAverage QuantConnect.Algorithm.QCAlgorithm.TRIMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new TriangularMovingAverage indicator.

Parameters
symbolThe symbol whose TRIMA we want
periodThe period over which to compute the TRIMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The TriangularMovingAverage indicator for the requested symbol over the specified period

Definition at line 1836 of file QCAlgorithm.Indicators.cs.

◆ TRIX()

Trix QuantConnect.Algorithm.QCAlgorithm.TRIX ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Trix indicator.

Parameters
symbolThe symbol whose TRIX we want
periodThe period over which to compute the TRIX
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Trix indicator for the requested symbol over the specified period

Definition at line 1858 of file QCAlgorithm.Indicators.cs.

◆ ULTOSC()

UltimateOscillator QuantConnect.Algorithm.QCAlgorithm.ULTOSC ( Symbol  symbol,
int  period1,
int  period2,
int  period3,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new UltimateOscillator indicator.

Parameters
symbolThe symbol whose ULTOSC we want
period1The first period over which to compute the ULTOSC
period2The second period over which to compute the ULTOSC
period3The third period over which to compute the ULTOSC
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The UltimateOscillator indicator for the requested symbol over the specified period

Definition at line 1882 of file QCAlgorithm.Indicators.cs.

◆ VAR()

Variance QuantConnect.Algorithm.QCAlgorithm.VAR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a new Variance indicator. This will return the population variance of samples over the specified period.

Parameters
symbolThe symbol whose VAR we want
periodThe period over which to compute the VAR
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Variance indicator for the requested symbol over the specified period

Definition at line 1904 of file QCAlgorithm.Indicators.cs.

◆ VWAP() [1/2]

VolumeWeightedAveragePriceIndicator QuantConnect.Algorithm.QCAlgorithm.VWAP ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, TradeBar selector = null 
)

Creates an VolumeWeightedAveragePrice (VWAP) indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose VWAP we want
periodThe period of the VWAP
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The VolumeWeightedAveragePrice for the given parameters

Definition at line 1927 of file QCAlgorithm.Indicators.cs.

◆ VWAP() [2/2]

IntradayVwap QuantConnect.Algorithm.QCAlgorithm.VWAP ( Symbol  symbol)

Creates the canonical VWAP indicator that resets each day. The indicator will be automatically updated on the security's configured resolution.

Parameters
symbolThe symbol whose VWAP we want
Returns
The IntradayVWAP for the specified symbol

Definition at line 1947 of file QCAlgorithm.Indicators.cs.

◆ WILR()

WilliamsPercentR QuantConnect.Algorithm.QCAlgorithm.WILR ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, IBaseDataBar selector = null 
)

Creates a new Williams R indicator. This will compute the percentage change of the current closing price in relation to the high and low of the past N periods. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose Williams R we want
periodThe period over which to compute the Williams R
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The Williams R indicator for the requested symbol over the specified period

Definition at line 1965 of file QCAlgorithm.Indicators.cs.

◆ WWMA()

WilderMovingAverage QuantConnect.Algorithm.QCAlgorithm.WWMA ( Symbol  symbol,
int  period,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates a WilderMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose WMA we want
periodThe period of the WMA
resolutionThe resolution
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
Returns
The WilderMovingAverage for the given parameters

WWMA for Welles Wilder Moving Average

Definition at line 1989 of file QCAlgorithm.Indicators.cs.

◆ SI()

WilderSwingIndex QuantConnect.Algorithm.QCAlgorithm.SI ( Symbol  symbol,
decimal  limitMove,
Resolution resolution = Resolution.Daily 
)

Creates a Wilder Swing Index (SI) indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose SI we want
limitMoveThe maximum daily change in price for the SI
resolutionThe resolution
Returns
The WilderSwingIndex for the given parameters

SI for Wilder Swing Index

Definition at line 2012 of file QCAlgorithm.Indicators.cs.

◆ ASI()

WilderAccumulativeSwingIndex QuantConnect.Algorithm.QCAlgorithm.ASI ( Symbol  symbol,
decimal  limitMove,
Resolution resolution = Resolution.Daily 
)

Creates a Wilder Accumulative Swing Index (ASI) indicator for the symbol. The indicator will be automatically updated on the given resolution.

Parameters
symbolThe symbol whose ASI we want
limitMoveThe maximum daily change in price for the ASI
resolutionThe resolution
Returns
The WilderAccumulativeSwingIndex for the given parameters

ASI for Wilder Accumulative Swing Index

Definition at line 2035 of file QCAlgorithm.Indicators.cs.

◆ TRIN() [1/2]

ArmsIndex QuantConnect.Algorithm.QCAlgorithm.TRIN ( IEnumerable< Symbol symbols,
Resolution resolution = null 
)

Creates a new Arms Index indicator

Parameters
symbolsThe symbols whose Arms Index we want
resolutionThe resolution
Returns
The Arms Index indicator for the requested symbol over the specified period

Definition at line 2055 of file QCAlgorithm.Indicators.cs.

◆ TRIN() [2/2]

ArmsIndex QuantConnect.Algorithm.QCAlgorithm.TRIN ( Symbol[]  symbols,
Resolution resolution = null 
)

Creates a new Arms Index indicator

Parameters
symbolsThe symbols whose Arms Index we want
resolutionThe resolution
Returns
The Arms Index indicator for the requested symbol over the specified period

Definition at line 2066 of file QCAlgorithm.Indicators.cs.

◆ ADR()

AdvanceDeclineRatio QuantConnect.Algorithm.QCAlgorithm.ADR ( IEnumerable< Symbol symbols,
Resolution resolution = null 
)

Creates a new Advance/Decline Ratio indicator

Parameters
symbolsThe symbols whose A/D Ratio we want
resolutionThe resolution
Returns
The Advance/Decline Ratio indicator for the requested symbol over the specified period

Definition at line 2090 of file QCAlgorithm.Indicators.cs.

◆ ADVR()

AdvanceDeclineVolumeRatio QuantConnect.Algorithm.QCAlgorithm.ADVR ( IEnumerable< Symbol symbols,
Resolution resolution = null 
)

Creates a new Advance/Decline Volume Ratio indicator

Parameters
symbolsThe symbol whose A/D Volume Rate we want
resolutionThe resolution
Returns
The Advance/Decline Volume Ratio indicator for the requested symbol over the specified period

Definition at line 2114 of file QCAlgorithm.Indicators.cs.

◆ CreateIndicatorName() [1/2]

string QuantConnect.Algorithm.QCAlgorithm.CreateIndicatorName ( Symbol  symbol,
FormattableString  type,
Resolution resolution 
)

Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)

Parameters
symbolThe symbol this indicator is registered to
typeThe indicator type, for example, 'SMA(5)'
resolutionThe resolution requested
Returns
A unique for the given parameters

Definition at line 2139 of file QCAlgorithm.Indicators.cs.

◆ CreateIndicatorName() [2/2]

string QuantConnect.Algorithm.QCAlgorithm.CreateIndicatorName ( Symbol  symbol,
string  type,
Resolution resolution 
)

Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)

Parameters
symbolThe symbol this indicator is registered to
typeThe indicator type, for example, 'SMA(5)'
resolutionThe resolution requested
Returns
A unique for the given parameters

Definition at line 2151 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator() [1/7]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator ( Symbol  symbol,
IndicatorBase< IndicatorDataPoint indicator,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
resolutionThe resolution at which to send data to the indicator, null to use the same resolution as the subscription
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)

Definition at line 2241 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator() [2/7]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator ( Symbol  symbol,
IndicatorBase< IndicatorDataPoint indicator,
TimeSpan?  resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Creates and registers a new consolidator to receive automatic updates at the specified resolution as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
resolutionThe resolution at which to send data to the indicator, null to use the same resolution as the subscription
selectorSelects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)

Definition at line 2254 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator() [3/7]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator ( Symbol  symbol,
IndicatorBase< IndicatorDataPoint indicator,
IDataConsolidator  consolidator,
Func< IBaseData, decimal >  selector = null 
)

Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
consolidatorThe consolidator to receive raw subscription data
selectorSelects a value from the BaseData send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)

Definition at line 2267 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator< T >() [1/4]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator< T > ( Symbol  symbol,
IndicatorBase< T >  indicator,
Resolution resolution = null 
)

Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
resolutionThe resolution at which to send data to the indicator, null to use the same resolution as the subscription
Type Constraints
T :IBaseData 

Definition at line 2290 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator< T >() [2/4]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator< T > ( Symbol  symbol,
IndicatorBase< T >  indicator,
Resolution resolution,
Func< IBaseData, T >  selector 
)

Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
resolutionThe resolution at which to send data to the indicator, null to use the same resolution as the subscription
selectorSelects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)
Type Constraints
T :IBaseData 

Definition at line 2304 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator< T >() [3/4]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator< T > ( Symbol  symbol,
IndicatorBase< T >  indicator,
TimeSpan?  resolution,
Func< IBaseData, T >  selector = null 
)

Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
resolutionThe resolution at which to send data to the indicator, null to use the same resolution as the subscription
selectorSelects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)
Type Constraints
T :IBaseData 

Definition at line 2318 of file QCAlgorithm.Indicators.cs.

◆ RegisterIndicator< T >() [4/4]

void QuantConnect.Algorithm.QCAlgorithm.RegisterIndicator< T > ( Symbol  symbol,
IndicatorBase< T >  indicator,
IDataConsolidator  consolidator,
Func< IBaseData, T >  selector = null 
)

Registers the consolidator to receive automatic updates as well as configures the indicator to receive updates from the consolidator.

Parameters
symbolThe symbol to register against
indicatorThe indicator to receive data from the consolidator
consolidatorThe consolidator to receive raw subscription data
selectorSelects a value from the BaseData send into the indicator, if null defaults to a cast (x => (T)x)
Type Constraints
T :IBaseData 

Definition at line 2332 of file QCAlgorithm.Indicators.cs.

◆ WarmUpIndicator() [1/2]

IndicatorBase<IndicatorDataPoint> QuantConnect.Algorithm.QCAlgorithm.WarmUpIndicator ( Symbol  symbol,
IndicatorBase< IndicatorDataPoint indicator,
Resolution resolution = null,
Func< IBaseData, decimal >  selector = null 
)

Warms up a given indicator with historical data

Parameters