Writing Algorithms
API Reference
Introduction
QCAlgorithm
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.
QCAlgorithm
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.
Adding Data
Adding Data
add_cfd(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0)
[source]AddCfd(ticker, resolution=None, market=None, fillForward=True, leverage=0.0)
[source]add_crypto(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0)
[source]AddCrypto(ticker, resolution=None, market=None, fillForward=True, leverage=0.0)
[source]add_crypto_future(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0)
[source]Creates and adds a new CryptoFuture security to the algorithm
- ticker (str) — The currency pair
- resolution (Resolution, optional)
- market (str, optional)
- fill_forward (bool, optional)
- leverage (float, optional)
The new CryptoFuture security
AddCryptoFuture(ticker, resolution=None, market=None, fillForward=True, leverage=0.0)
[source]Creates and adds a new CryptoFuture security to the algorithm
- ticker (string) — The currency pair
- resolution (Resolution, optional)
- market (string, optional)
- fillForward (bool, optional)
- leverage (decimal, optional)
The new CryptoFuture security
add_data(type, ticker, properties, exchange_hours, resolution, fill_forward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- ticker (str) — KeyTicker for data
- properties (SymbolProperties) — The properties of this new custom data
- exchange_hours (SecurityExchangeHours) — The Exchange hours of this symbol
- resolution (Optional[Resolution]) — Resolution of the Data Required
- fill_forward (bool) — When no data available on a tradebar, return the last data that was generated
- leverage (float, optional) — Custom leverage per security
The new Security
add_data(type, ticker, resolution, time_zone, fill_forward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- ticker (str) — KeyTicker for data
- resolution (Optional[Resolution]) — Resolution of the Data Required
- time_zone (datetimeZone) — Specifies the time zone of the raw data
- fill_forward (bool) — When no data available on a tradebar, return the last data that was generated
- leverage (float, optional) — Custom leverage per security
The new Security
add_data(type, underlying, resolution, time_zone, fill_forward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- underlying (Symbol) — The underlying symbol for the custom data
- resolution (Optional[Resolution]) — Resolution of the Data Required
- time_zone (datetimeZone) — Specifies the time zone of the raw data
- fill_forward (bool) — When no data available on a tradebar, return the last data that was generated
- leverage (float, optional) — Custom leverage per security
The new Security
add_data(data_type, ticker, resolution, time_zone, fill_forward, leverage=1.0)
[source]AddDataT 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)
- data_type (Type) — Data source type
- ticker (str) — KeyTicker for data
- resolution (Optional[Resolution]) — Resolution of the Data Required
- time_zone (datetimeZone) — Specifies the time zone of the raw data
- fill_forward (bool) — When no data available on a tradebar, return the last data that was generated
- leverage (float, optional) — Custom leverage per security
The new Security
add_data(data_type, underlying, resolution, time_zone, fill_forward, leverage=1.0)
[source]AddDataT 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)
- data_type (Type) — Data source type
- underlying (Symbol)
- resolution (Optional[Resolution]) — Resolution of the Data Required
- time_zone (datetimeZone) — Specifies the time zone of the raw data
- fill_forward (bool) — When no data available on a tradebar, return the last data that was generated
- leverage (float, optional) — Custom leverage per security
The new Security
AddData(type, ticker, properties, exchangeHours, resolution, fillForward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- ticker (string) — KeyTicker for data
- properties (SymbolProperties) — The properties of this new custom data
- exchangeHours (SecurityExchangeHours) — The Exchange hours of this symbol
- resolution (Nullable[Resolution]) — Resolution of the Data Required
- fillForward (Boolean) — When no data available on a tradebar, return the last data that was generated
- leverage (decimal, optional) — Custom leverage per security
The new Security
AddData(type, ticker, resolution, timeZone, fillForward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- ticker (string) — KeyTicker for data
- resolution (Nullable[Resolution]) — Resolution of the Data Required
- timeZone (DateTimeZone) — Specifies the time zone of the raw data
- fillForward (Boolean) — When no data available on a tradebar, return the last data that was generated
- leverage (decimal, optional) — Custom leverage per security
The new Security
AddData(type, underlying, resolution, timeZone, fillForward, leverage=1.0)
[source]AddDataT 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)
- type (PyObject) — Data source type
- underlying (Symbol) — The underlying symbol for the custom data
- resolution (Nullable[Resolution]) — Resolution of the Data Required
- timeZone (DateTimeZone) — Specifies the time zone of the raw data
- fillForward (Boolean) — When no data available on a tradebar, return the last data that was generated
- leverage (decimal, optional) — Custom leverage per security
The new Security
AddData(dataType, ticker, resolution, timeZone, fillForward, leverage=1.0)
[source]AddDataT 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)
- dataType (Type) — Data source type
- ticker (string) — KeyTicker for data
- resolution (Nullable[Resolution]) — Resolution of the Data Required
- timeZone (DateTimeZone) — Specifies the time zone of the raw data
- fillForward (Boolean) — When no data available on a tradebar, return the last data that was generated
- leverage (decimal, optional) — Custom leverage per security
The new Security
AddData(dataType, underlying, resolution, timeZone, fillForward, leverage=1.0)
[source]AddDataT 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)
- dataType (Type) — Data source type
- underlying (Symbol)
- resolution (Nullable[Resolution]) — Resolution of the Data Required
- timeZone (DateTimeZone) — Specifies the time zone of the raw data
- fillForward (Boolean) — When no data available on a tradebar, return the last data that was generated
- leverage (decimal, optional) — Custom leverage per security
The new Security
add_equity(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0, extended_market_hours=False, data_normalization_mode=None)
[source]Creates and adds a new Equity security to the algorithm
- ticker (str) — The equity ticker symbol
- resolution (Resolution, optional)
- market (str, optional)
- fill_forward (bool, optional)
- leverage (float, optional)
- extended_market_hours (bool, optional)
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the equity
The new Equity security
AddEquity(ticker, resolution=None, market=None, fillForward=True, leverage=0.0, extendedMarketHours=False, dataNormalizationMode=None)
[source]Creates and adds a new Equity security to the algorithm
- ticker (string) — The equity ticker symbol
- resolution (Resolution, optional)
- market (string, optional)
- fillForward (bool, optional)
- leverage (decimal, optional)
- extendedMarketHours (bool, optional)
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the equity
The new Equity security
add_forex(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0)
[source]AddForex(ticker, resolution=None, market=None, fillForward=True, leverage=0.0)
[source]add_future(ticker, resolution=None, market=None, fill_forward=True, leverage=0.0, extended_market_hours=False, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=0)
[source]Creates and adds a new Future security to the algorithm
- ticker (str) — The future ticker
- resolution (Resolution, optional)
- market (str, optional)
- fill_forward (bool, optional)
- leverage (float, optional)
- extended_market_hours (bool, optional) — Use extended market hours data
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the continuous future contract
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the continuous future contract
- contract_depth_offset (int, optional) — The continuous future contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract
The new Future security
AddFuture(ticker, resolution=None, market=None, fillForward=True, leverage=0.0, extendedMarketHours=False, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=0)
[source]Creates and adds a new Future security to the algorithm
- ticker (string) — The future ticker
- resolution (Resolution, optional)
- market (string, optional)
- fillForward (bool, optional)
- leverage (decimal, optional)
- extendedMarketHours (bool, optional) — Use extended market hours data
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the continuous future contract
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the continuous future contract
- contractDepthOffset (Int32, optional) — The continuous future contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract
The new Future security
add_future_contract(symbol, resolution=None, fill_forward=True, leverage=0.0, extended_market_hours=False)
[source]Creates and adds a new single Future contract to the algorithm
- symbol (Symbol) — The futures contract symbol
- resolution (Resolution, optional)
- fill_forward (bool, optional)
- leverage (float, optional)
- extended_market_hours (bool, optional) — Use extended market hours data
The new Future security
AddFutureContract(symbol, resolution=None, fillForward=True, leverage=0.0, extendedMarketHours=False)
[source]Creates and adds a new single Future contract to the algorithm
- symbol (Symbol) — The futures contract symbol
- resolution (Resolution, optional)
- fillForward (bool, optional)
- leverage (decimal, optional)
- extendedMarketHours (bool, optional) — Use extended market hours data
The new Future security
add_future_option(future_symbol, option_filter)
[source]Creates and adds a new Future Option contract to the algorithm.
- future_symbol (Symbol) — )
- option_filter (PyObject) — Filter to apply to option contracts loaded as part of the universe
add_future_option(symbol, option_filter=None)
[source]Creates and adds a new Future Option contract to the algorithm.
- symbol (Symbol) — )
- option_filter (Callable[OptionFilterUniverse, OptionFilterUniverse], optional) — Filter to apply to option contracts loaded as part of the universe
AddFutureOption(futureSymbol, optionFilter)
[source]Creates and adds a new Future Option contract to the algorithm.
- futureSymbol (Symbol) — )
- optionFilter (PyObject) — Filter to apply to option contracts loaded as part of the universe
AddFutureOption(symbol, optionFilter=None)
[source]Creates and adds a new Future Option contract to the algorithm.
- symbol (Symbol) — )
- optionFilter (Func<OptionFilterUniverse, OptionFilterUniverse>, optional) — Filter to apply to option contracts loaded as part of the universe
add_future_option_contract(symbol, resolution=None, fill_forward=True, leverage=0.0, extended_market_hours=False)
[source]Adds a future option contract to the algorithm.
- symbol (Symbol) — Option contract Symbol
- resolution (Resolution, optional) — Resolution of the option contract, i.e. the granularity of the data
- fill_forward (bool, optional) — If true, this will fill in missing data points with the previous data point
- leverage (float, optional) — The leverage to apply to the option contract
- extended_market_hours (bool, optional) — Use extended market hours data
Option security
AddFutureOptionContract(symbol, resolution=None, fillForward=True, leverage=0.0, extendedMarketHours=False)
[source]Adds a future option contract to the algorithm.
- symbol (Symbol) — Option contract Symbol
- resolution (Resolution, optional) — Resolution of the option contract, i.e. the granularity of the data
- fillForward (bool, optional) — If true, this will fill in missing data points with the previous data point
- leverage (decimal, optional) — The leverage to apply to the option contract
- extendedMarketHours (bool, optional) — Use extended market hours data
Option security
add_index(ticker, resolution=None, market=None, fill_forward=True)
[source]AddIndex(ticker, resolution=None, market=None, fillForward=True)
[source]add_index_option(underlying, target_option, resolution=None, market=None, fill_forward=True)
[source]Creates and adds index options to the algorithm.
- underlying (str) — The underlying ticker of the Index Option
- target_option (str) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional) — Resolution of the index option contracts, i.e. the granularity of the data
- market (str, optional)
- fill_forward (bool, optional) — If true, this will fill in missing data points with the previous data point
Canonical Option security
add_index_option(symbol, target_option, resolution=None, fill_forward=True)
[source]Creates and adds index options to the algorithm.
- symbol (Symbol)
- target_option (str) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional) — Resolution of the index option contracts, i.e. the granularity of the data
- fill_forward (bool, optional) — If true, this will fill in missing data points with the previous data point
Canonical Option security
AddIndexOption(underlying, targetOption, resolution=None, market=None, fillForward=True)
[source]Creates and adds index options to the algorithm.
- underlying (string) — The underlying ticker of the Index Option
- targetOption (string) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional) — Resolution of the index option contracts, i.e. the granularity of the data
- market (string, optional)
- fillForward (bool, optional) — If true, this will fill in missing data points with the previous data point
Canonical Option security
AddIndexOption(symbol, targetOption, resolution=None, fillForward=True)
[source]Creates and adds index options to the algorithm.
- symbol (Symbol)
- targetOption (string) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional) — Resolution of the index option contracts, i.e. the granularity of the data
- fillForward (bool, optional) — If true, this will fill in missing data points with the previous data point
Canonical Option security
add_index_option_contract(symbol, resolution=None, fill_forward=True)
[source]Adds an index option contract to the algorithm.
- symbol (Symbol) — Symbol of the index option contract
- resolution (Resolution, optional) — Resolution of the index option contract, i.e. the granularity of the data
- fill_forward (bool, optional) — If true, this will fill in missing data points with the previous data point
Index Option Contract
AddIndexOptionContract(symbol, resolution=None, fillForward=True)
[source]Adds an index option contract to the algorithm.
- symbol (Symbol) — Symbol of the index option contract
- resolution (Resolution, optional) — Resolution of the index option contract, i.e. the granularity of the data
- fillForward (bool, optional) — If true, this will fill in missing data points with the previous data point
Index Option Contract
add_option(underlying, target_option, resolution=None, market=None, fill_forward=True, leverage=0.0)
[source]Creates and adds a new equity Option security to the algorithm
- underlying (Symbol | str) — Underlying asset Symbol to use as the option's underlying
- target_option (str) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional)
- market (str, optional)
- fill_forward (bool, optional) — If 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.
- leverage (float, optional) — The requested leverage for the
The new option security instance
AddOption(underlying, targetOption, resolution=None, market=None, fillForward=True, leverage=0.0)
[source]Creates and adds a new equity Option security to the algorithm
- underlying (String | Symbol) — Underlying asset Symbol to use as the option's underlying
- targetOption (string) — The target option ticker. This is useful when the option ticker does not match the underlying, e.g. SPX index and the SPXW weekly option. If null is provided will use underlying
- resolution (Resolution, optional)
- market (string, optional)
- fillForward (bool, optional) — If 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.
- leverage (decimal, optional) — The requested leverage for the
The new option security instance
add_option_contract(symbol, resolution=None, fill_forward=True, leverage=0.0, extended_market_hours=False)
[source]Creates and adds a new single Option contract to the algorithm
- symbol (Symbol) — The option contract symbol
- resolution (Resolution, optional)
- fill_forward (bool, optional)
- leverage (float, optional)
- extended_market_hours (bool, optional) — Use extended market hours data
The new Option security
AddOptionContract(symbol, resolution=None, fillForward=True, leverage=0.0, extendedMarketHours=False)
[source]Creates and adds a new single Option contract to the algorithm
- symbol (Symbol) — The option contract symbol
- resolution (Resolution, optional)
- fillForward (bool, optional)
- leverage (decimal, optional)
- extendedMarketHours (bool, optional) — Use extended market hours data
The new Option security
add_security(security_type, ticker, resolution, market, fill_forward, leverage, extended_market_hours, data_mapping_mode=None, data_normalization_mode=None)
[source]Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.
- security_type (SecurityType) — MarketType Type: Equity, Commodity, Future, FOREX or Crypto
- ticker (str) — The security ticker, e.g. AAPL
- resolution (Optional[Resolution]) — Resolution of the MarketType required: MarketData, Second or Minute
- market (str) — The market the requested security belongs to, such as 'usa' or 'fxcm'
- fill_forward (bool) — If true, returns the last available data even if none in that timeslice.
- leverage (float) — leverage for this security
- extended_market_hours (bool) — Use extended market hours data
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the security
add_security(symbol, resolution=None, fill_forward=True, leverage=0.0, extended_market_hours=False, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=0)
[source]Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.
- symbol (Symbol) — The security Symbol
- resolution (Resolution, optional) — Resolution of the MarketType required: MarketData, Second or Minute
- fill_forward (bool, optional) — If true, returns the last available data even if none in that timeslice.
- leverage (float, optional) — leverage for this security
- extended_market_hours (bool, optional) — Use extended market hours data
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the security
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract
The new Security that was added to the algorithm
AddSecurity(securityType, ticker, resolution, market, fillForward, leverage, extendedMarketHours, dataMappingMode=None, dataNormalizationMode=None)
[source]Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.
- securityType (SecurityType) — MarketType Type: Equity, Commodity, Future, FOREX or Crypto
- ticker (string) — The security ticker, e.g. AAPL
- resolution (Nullable[Resolution]) — Resolution of the MarketType required: MarketData, Second or Minute
- market (string) — The market the requested security belongs to, such as 'usa' or 'fxcm'
- fillForward (Boolean) — If true, returns the last available data even if none in that timeslice.
- leverage (decimal) — leverage for this security
- extendedMarketHours (Boolean) — Use extended market hours data
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the security
AddSecurity(symbol, resolution=None, fillForward=True, leverage=0.0, extendedMarketHours=False, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=0)
[source]Add specified data to our data subscriptions. QuantConnect will funnel this data to the handle data routine.
- symbol (Symbol) — The security Symbol
- resolution (Resolution, optional) — Resolution of the MarketType required: MarketData, Second or Minute
- fillForward (bool, optional) — If true, returns the last available data even if none in that timeslice.
- leverage (decimal, optional) — leverage for this security
- extendedMarketHours (bool, optional) — Use extended market hours data
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the security
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 (default) will use the front month, 1 will use the back month contract
The new Security that was added to the algorithm
download(address, headers, user_name, password)
[source]Downloads the requested resource as a String. The resource to download is specified as a String containing the URI.
- address (str) — A string containing the URI to download
- headers (PyObject | Dict[str, str]) — Defines header values to add to the request
- user_name (str) — The user name associated with the credentials
- password (str) — The password for the user name associated with the credentials
The requested resource as a string
str
Download(address, headers, userName, password)
[source]Downloads the requested resource as a String. The resource to download is specified as a String containing the URI.
- address (string) — A string containing the URI to download
- headers (PyObject | KeyValuePair[String, String]) — Defines header values to add to the request
- userName (string) — The user name associated with the credentials
- password (string) — The password for the user name associated with the credentials
The requested resource as a string
String
get_last_known_prices(security)
[source]Yields data to warmup a security for all it's subscribed data types
- security (Security) — object for which to retrieve historical data
Securities historical data
List[BaseData]
get_last_known_prices(symbol)
[source]Yields data to warmup a security for all it's subscribed data types
- symbol (Symbol) — The symbol we want to get seed data for
Securities historical data
List[BaseData]
GetLastKnownPrices(security)
[source]Yields data to warmup a security for all it's subscribed data types
- security (Security) — object for which to retrieve historical data
Securities historical data
IEnumerable[BaseData]
GetLastKnownPrices(symbol)
[source]Yields data to warmup a security for all it's subscribed data types
- symbol (Symbol) — The symbol we want to get seed data for
Securities historical data
IEnumerable[BaseData]
on_securities_changed(changes)
[source]Event fired each time the we add/remove securities from the data feed
- changes (SecurityChanges) — Security additionsremovals for this time step
OnSecuritiesChanged(changes)
[source]Event fired each time the we add/remove securities from the data feed
- changes (SecurityChanges) — Security additionsremovals for this time step
option_chain(symbol)
[source]Get the option chain for the specified symbol at the current time (Time)
- symbol (Symbol) — The symbol for which the option chain is asked for. It can be either the canonical option or the underlying symbol.
The option chain
OptionChain(symbol)
[source]Get the option chain for the specified symbol at the current time (Time)
- symbol (Symbol) — The symbol for which the option chain is asked for. It can be either the canonical option or the underlying symbol.
The option chain
option_chains(symbols)
[source]Get the option chains for the specified symbols at the current time (Time)
- symbols (List[Symbol] | PyObject) — The symbols for which the option chain is asked for. It can be either the canonical options or the underlying symbols.
The option chains
OptionChains(symbols)
[source]Get the option chains for the specified symbols at the current time (Time)
- symbols (PyObject | IEnumerable[Symbol]) — The symbols for which the option chain is asked for. It can be either the canonical options or the underlying symbols.
The option chains
remove_option_contract(symbol)
[source]Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings
- symbol (Symbol) — The symbol of the security to be removed
bool
RemoveOptionContract(symbol)
[source]Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings
- symbol (Symbol) — The symbol of the security to be removed
Boolean
remove_security(symbol)
[source]Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings
- symbol (Symbol) — The symbol of the security to be removed
bool
RemoveSecurity(symbol)
[source]Removes the security with the specified symbol. This will cancel all open orders and then liquidate any existing holdings
- symbol (Symbol) — The symbol of the security to be removed
Boolean
set_future_chain_provider(future_chain_provider)
[source]Sets the future chain provider, used to get the list of future contracts for an underlying symbol
- future_chain_provider (IFutureChainProvider) — The future chain provider
SetFutureChainProvider(futureChainProvider)
[source]Sets the future chain provider, used to get the list of future contracts for an underlying symbol
- futureChainProvider (IFutureChainProvider) — The future chain provider
set_option_chain_provider(option_chain_provider)
[source]Sets the option chain provider, used to get the list of option contracts for an underlying symbol
- option_chain_provider (IOptionChainProvider) — The option chain provider
SetOptionChainProvider(optionChainProvider)
[source]Sets the option chain provider, used to get the list of option contracts for an underlying symbol
- optionChainProvider (IOptionChainProvider) — The option chain provider
set_security_initializer(security_initializer)
[source]Sets the security initializer, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities.
- security_initializer (ISecurityInitializer | Action[Security] | PyObject) — The security initializer function or class
SetSecurityInitializer(securityInitializer)
[source]Sets the security initializer, used to initialize/configure securities after creation. The initializer will be applied to all universes and manually added securities.
- securityInitializer (ISecurityInitializer | Action[Security] | PyObject) — The security initializer function or class
symbol(ticker)
[source]Converts the string 'ticker' symbol into a full String) object This requires that the string 'ticker' has been added to the algorithm
- ticker (str) — The ticker symbol. This should be the ticker symbol as it was added to the algorithm
The symbol object mapped to the specified ticker
Symbol(ticker)
[source]Converts the string 'ticker' symbol into a full String) object This requires that the string 'ticker' has been added to the algorithm
- ticker (string) — The ticker symbol. This should be the ticker symbol as it was added to the algorithm
The symbol object mapped to the specified ticker
ticker(symbol)
[source]For the given symbol will resolve the ticker it used at the current algorithm date
- symbol (Symbol) — The symbol to get the ticker for
The mapped ticker for a symbol
str
Ticker(symbol)
[source]For the given symbol will resolve the ticker it used at the current algorithm date
- symbol (Symbol) — The symbol to get the ticker for
The mapped ticker for a symbol
String
Gets the future chain provider, used to get the list of future contracts for an underlying symbol
Gets the future chain provider, used to get the list of future contracts for an underlying symbol
IFutureChainProvider
Gets the future chain provider, used to get the list of future contracts for an underlying symbol
Gets the future chain provider, used to get the list of future contracts for an underlying symbol
IFutureChainProvider
Gets an instance that is to be used to initialize newly created securities.
Gets an instance that is to be used to initialize newly created securities.
ISecurityInitializer
Gets an instance that is to be used to initialize newly created securities.
Gets an instance that is to be used to initialize newly created securities.
ISecurityInitializer
Algorithm Framework
Algorithm Framework
add_alpha(alpha)
[source]Adds a new alpha model
- alpha (PyObject | IAlphaModel) — Model that generates alpha to add
AddAlpha(alpha)
[source]Adds a new alpha model
- alpha (PyObject | IAlphaModel) — Model that generates alpha to add
add_risk_management(risk_management)
[source]Adds a new risk management model
- risk_management (IRiskManagementModel | PyObject) — Model defining how risk is managed to add
AddRiskManagement(riskManagement)
[source]Adds a new risk management model
- riskManagement (IRiskManagementModel | PyObject) — Model defining how risk is managed to add
add_universe_selection(universe_selection)
[source]Adds a new universe selection model
- universe_selection (PyObject | IUniverseSelectionModel) — Model defining universes for the algorithm to add
AddUniverseSelection(universeSelection)
[source]Adds a new universe selection model
- universeSelection (PyObject | IUniverseSelectionModel) — Model defining universes for the algorithm to add
emit_insights(insights)
[source]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.
- insights (Insight[]) — The array of insights to be emitted
emit_insights(insight)
[source]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.
- insight (Insight) — The insight to be emitted
EmitInsights(insights)
[source]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.
- insights (Insight[]) — The array of insights to be emitted
EmitInsights(insight)
[source]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.
- insight (Insight) — The insight to be emitted
framework_post_initialize()
[source]Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method
FrameworkPostInitialize()
[source]Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method
get_locked()
[source]Gets whether or not this algorithm has been locked and fully initialized
bool
GetLocked()
[source]Gets whether or not this algorithm has been locked and fully initialized
Boolean
initialize()
[source]Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
Initialize()
[source]Initialise the data and resolution required, as well as the cash and start-end dates for your algorithm. All algorithms must initialized.
on_framework_data(slice)
[source]Used to send data updates to algorithm framework models
- slice (Slice) — The current data slice
OnFrameworkData(slice)
[source]Used to send data updates to algorithm framework models
- slice (Slice) — The current data slice
on_framework_securities_changed(changes)
[source]Used to send security changes to algorithm framework models
- changes (SecurityChanges) — Security additionsremovals for this time step
OnFrameworkSecuritiesChanged(changes)
[source]Used to send security changes to algorithm framework models
- changes (SecurityChanges) — Security additionsremovals for this time step
post_initialize()
[source]Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method
PostInitialize()
[source]Called by setup handlers after Initialize and allows the algorithm a chance to organize the data gather in the Initialize method
set_alpha(alpha)
[source]Sets the alpha model
- alpha (PyObject | IAlphaModel) — Model that generates alpha
SetAlpha(alpha)
[source]Sets the alpha model
- alpha (PyObject | IAlphaModel) — Model that generates alpha
set_execution(execution)
[source]Sets the execution model
- execution (PyObject | IExecutionModel) — Model defining how to execute trades to reach a portfolio target
SetExecution(execution)
[source]Sets the execution model
- execution (PyObject | IExecutionModel) — Model defining how to execute trades to reach a portfolio target
set_locked()
[source]Lock the algorithm initialization to avoid user modifiying cash and data stream subscriptions
SetLocked()
[source]Lock the algorithm initialization to avoid user modifiying cash and data stream subscriptions
set_portfolio_construction(portfolio_construction)
[source]Sets the portfolio construction model
- portfolio_construction (PyObject | IPortfolioConstructionModel) — Model defining how to build a portfolio from insights
SetPortfolioConstruction(portfolioConstruction)
[source]Sets the portfolio construction model
- portfolioConstruction (PyObject | IPortfolioConstructionModel) — Model defining how to build a portfolio from insights
set_risk_management(risk_management)
[source]Sets the risk management model
- risk_management (IRiskManagementModel | PyObject) — Model defining how risk is managed
SetRiskManagement(riskManagement)
[source]Sets the risk management model
- riskManagement (IRiskManagementModel | PyObject) — Model defining how risk is managed
set_universe_selection(universe_selection)
[source]Sets the universe selection model
- universe_selection (PyObject | IUniverseSelectionModel) — Model defining universes for the algorithm
SetUniverseSelection(universeSelection)
[source]Sets the universe selection model
- universeSelection (PyObject | IUniverseSelectionModel) — Model defining universes for the algorithm
Gets or sets the alpha model
Gets or sets the alpha model
IAlphaModel
Gets or sets the alpha model
Gets or sets the alpha model
IAlphaModel
Gets or sets the execution model
Gets or sets the execution model
IExecutionModel
Gets or sets the execution model
Gets or sets the execution model
IExecutionModel
Gets the insight manager
Gets the insight manager
InsightManager
Gets the insight manager
Gets the insight manager
InsightManager
Gets or sets the portfolio construction model
Gets or sets the portfolio construction model
IPortfolioConstructionModel
Gets or sets the portfolio construction model
Gets or sets the portfolio construction model
IPortfolioConstructionModel
Gets or sets the risk management model
Gets or sets the risk management model
IRiskManagementModel
Gets or sets the risk management model
Gets or sets the risk management model
IRiskManagementModel
Gets or sets the universe selection model.
Gets or sets the universe selection model.
IUniverseSelectionModel
Gets or sets the universe selection model.
Gets or sets the universe selection model.
IUniverseSelectionModel
Charting
Charting
add_chart(chart)
[source]Add a Chart object to algorithm collection
- chart (Chart) — Chart object to add to collection.
AddChart(chart)
[source]Add a Chart object to algorithm collection
- chart (Chart) — Chart object to add to collection.
add_series(chart, series, series_type, unit=$)
[source]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.
- chart (str) — The chart name
- series (str) — The series name
- series_type (SeriesType) — The type of series, i.e, Scatter
- unit (str, optional) — The unit of the y axis, usually $
AddSeries(chart, series, seriesType, unit=$)
[source]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.
- chart (string) — The chart name
- series (string) — The series name
- seriesType (SeriesType) — The type of series, i.e, Scatter
- unit (string, optional) — The unit of the y axis, usually $
get_chart_updates(clear_chart_data=False)
[source]Get the chart updates by fetch the recent points added and return for dynamic Charting.
- clear_chart_data (bool, optional)
List of chart updates since the last request
List[Chart]
GetChartUpdates(clearChartData=False)
[source]Get the chart updates by fetch the recent points added and return for dynamic Charting.
- clearChartData (bool, optional)
List of chart updates since the last request
IEnumerable[Chart]
plot(chart, series, open, high, low, close)
[source]Plot a chart using string series name, with value.
- chart (str) — Chart name
- series (str) — Series name
- open (int | float) — The candlestick open value
- high (int | float) — The candlestick high value
- low (int | float) — The candlestick low value
- close (int | float) — The candlestick close value
plot(chart, first, second=None, third=None, fourth=None)
[source]Plot a chart using string series name, with value.
- chart (str) — The chart's name
- first (TradeBarIndicator | Indicator | BarIndicator) — The first indicator to plot
- second (TradeBarIndicator | Indicator | BarIndicator, optional) — The second indicator to plot
- third (TradeBarIndicator | Indicator | BarIndicator, optional) — The third indicator to plot
- fourth (TradeBarIndicator | Indicator | BarIndicator, optional) — The fourth indicator to plot
plot(chart, series, value)
[source]Plot a chart using string series name, with value.
- chart (str)
- series (str)
- value (int | float)
plot(chart, series, bar)
[source]Plot a chart using string series name, with value.
- chart (str) — Chart name
- series (str) — Name of the plot series
- bar (TradeBar) — The trade bar to be plotted to the candlestick series
plot(chart, indicators)
[source]Plot a chart using string series name, with value.
- chart (str) — The chart's name
- indicators (IndicatorBase[]) — The indicators to plot
plot(series, py_object)
[source]Plot a chart using string series name, with value.
- series (str) — Name of the plot series
- py_object (PyObject) — PyObject with the value to plot
Plot(chart, series, open, high, low, close)
[source]Plot a chart using string series name, with value.
- chart (string) — Chart name
- series (string) — Series name
- open (Int32 | Decimal | Double | Single) — The candlestick open value
- high (Int32 | Decimal | Double | Single) — The candlestick high value
- low (Int32 | Decimal | Double | Single) — The candlestick low value
- close (Int32 | Decimal | Double | Single) — The candlestick close value
Plot(chart, first, second=None, third=None, fourth=None)
[source]Plot a chart using string series name, with value.
- chart (string) — The chart's name
- first (TradeBarIndicator | Indicator | BarIndicator) — The first indicator to plot
- second (TradeBarIndicator | Indicator | BarIndicator, optional) — The second indicator to plot
- third (TradeBarIndicator | Indicator | BarIndicator, optional) — The third indicator to plot
- fourth (TradeBarIndicator | Indicator | BarIndicator, optional) — The fourth indicator to plot
Plot(chart, series, value)
[source]Plot a chart using string series name, with value.
- chart (string)
- series (string)
- value (Int32 | Decimal | Double | Single)
Plot(chart, series, bar)
[source]Plot a chart using string series name, with value.
- chart (string) — Chart name
- series (string) — Name of the plot series
- bar (TradeBar) — The trade bar to be plotted to the candlestick series
Plot(chart, indicators)
[source]Plot a chart using string series name, with value.
- chart (string) — The chart's name
- indicators (IndicatorBase[]) — The indicators to plot
Plot(series, pyObject)
[source]Plot a chart using string series name, with value.
- series (string) — Name of the plot series
- pyObject (PyObject) — PyObject with the value to plot
plot_indicator(chart, wait_for_ready, first, second=None, third=None, fourth=None)
[source]Automatically plots each indicator when a new value is available
- chart (str)
- wait_for_ready (bool)
- first (PyObject)
- second (PyObject, optional)
- third (PyObject, optional)
- fourth (PyObject, optional)
plot_indicator(chart, wait_for_ready, indicators)
[source]Automatically plots each indicator when a new value is available
- chart (str)
- wait_for_ready (bool)
- indicators (IndicatorBase[])
PlotIndicator(chart, waitForReady, first, second=None, third=None, fourth=None)
[source]Automatically plots each indicator when a new value is available
- chart (string)
- waitForReady (bool)
- first (PyObject)
- second (PyObject, optional)
- third (PyObject, optional)
- fourth (PyObject, optional)
PlotIndicator(chart, waitForReady, indicators)
[source]Automatically plots each indicator when a new value is available
- chart (string)
- waitForReady (bool)
- indicators (IndicatorBase[])
record(series, value)
[source]Plot a chart using string series name, with int value. Alias of Plot();
- series (str)
- value (int | float)
Record(series, value)
[source]Plot a chart using string series name, with int value. Alias of Plot();
- series (string)
- value (Int32 | Decimal | Double)
set_runtime_statistic(name, value)
[source]Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.
- name (str) — Name of your runtime statistic
- value (str | int | float) — String value of your runtime statistic
SetRuntimeStatistic(name, value)
[source]Set a runtime statistic for the algorithm. Runtime statistics are shown in the top banner of a live algorithm GUI.
- name (string) — Name of your runtime statistic
- value (Int32 | Decimal | Double | String) — String value of your runtime statistic
Access to the runtime statistics property. User provided statistics.
Access to the runtime statistics property. User provided statistics.
Dict[str, str]
Access to the runtime statistics property. User provided statistics.
Access to the runtime statistics property. User provided statistics.
ConcurrentDictionary<String, String>
Consolidating Data
Consolidating Data
consolidate(symbol, period, tick_type, handler)
[source]Registers the handler to receive consolidated data for the specified symbol
- symbol (Symbol) — The symbol who's data is to be consolidated
- period (Resolution | timedelta) — The symbol who's data is to be consolidated
- tick_type (TickType) — The consolidation period
- handler (Action[TradeBar] | None | Action[QuoteBar] | PyObject) — The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.
A new consolidator matching the requested parameters with the handler already registered
IDataConsolidator
consolidate(symbol, calendar, tick_type, handler)
[source]Registers the handler to receive consolidated data for the specified symbol
- symbol (Symbol) — The symbol who's data is to be consolidated
- calendar (Callable[datetime, CalendarInfo]) — The symbol who's data is to be consolidated
- tick_type (TickType) — The consolidation calendar
- handler (Action[TradeBar] | None | Action[QuoteBar] | PyObject) — The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.
A new consolidator matching the requested parameters with the handler already registered
IDataConsolidator
Consolidate(symbol, period, tickType, handler)
[source]Registers the handler to receive consolidated data for the specified symbol
- symbol (Symbol) — The symbol who's data is to be consolidated
- period (Resolution | TimeSpan) — The symbol who's data is to be consolidated
- tickType (TickType) — The consolidation period
- handler (Action[TradeBar] | None | Action[QuoteBar] | PyObject) — The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.
A new consolidator matching the requested parameters with the handler already registered
IDataConsolidator
Consolidate(symbol, calendar, tickType, handler)
[source]Registers the handler to receive consolidated data for the specified symbol
- symbol (Symbol) — The symbol who's data is to be consolidated
- calendar (Func<DateTime, CalendarInfo>) — The symbol who's data is to be consolidated
- tickType (TickType) — The consolidation calendar
- handler (Action[TradeBar] | None | Action[QuoteBar] | PyObject) — The tick type of subscription used as data source for consolidator. Specify null to use first subscription found.
A new consolidator matching the requested parameters with the handler already registered
IDataConsolidator
deregister_indicator(indicator)
[source]Will deregister an indicator and it's associated consolidator instance so they stop receiving data updates
- indicator (IndicatorBase) — The indicator instance to deregister
DeregisterIndicator(indicator)
[source]Will deregister an indicator and it's associated consolidator instance so they stop receiving data updates
- indicator (IndicatorBase) — The indicator instance to deregister
resolve_consolidator(symbol, resolution, data_type=None)
[source]Gets the default consolidator for the specified symbol and resolution
- symbol (Symbol) — The symbol whose data is to be consolidated
- resolution (Resolution) — The resolution for the consolidator, if null, uses the resolution from subscription
- data_type (Type, optional) — The data type for this consolidator, if null, uses TradeBar over QuoteBar if present
The new default consolidator
IDataConsolidator
resolve_consolidator(symbol, time_span, data_type=None)
[source]Gets the default consolidator for the specified symbol and resolution
- symbol (Symbol) — The symbol whose data is to be consolidated
- time_span (timedelta) — The requested time span for the consolidator, if null, uses the resolution from subscription
- data_type (Type, optional) — The data type for this consolidator, if null, uses TradeBar over QuoteBar if present
The new default consolidator
IDataConsolidator
ResolveConsolidator(symbol, resolution, dataType=None)
[source]Gets the default consolidator for the specified symbol and resolution
- symbol (Symbol) — The symbol whose data is to be consolidated
- resolution (Resolution) — The resolution for the consolidator, if null, uses the resolution from subscription
- dataType (Type, optional) — The data type for this consolidator, if null, uses TradeBar over QuoteBar if present
The new default consolidator
IDataConsolidator
ResolveConsolidator(symbol, timeSpan, dataType=None)
[source]Gets the default consolidator for the specified symbol and resolution
- symbol (Symbol) — The symbol whose data is to be consolidated
- timeSpan (TimeSpan) — The requested time span for the consolidator, if null, uses the resolution from subscription
- dataType (Type, optional) — The data type for this consolidator, if null, uses TradeBar over QuoteBar if present
The new default consolidator
IDataConsolidator
unregister_indicator(indicator)
[source]Will unregister an indicator and it's associated consolidator instance so they stop receiving data updates
- indicator (IndicatorBase) — The indicator instance to unregister
UnregisterIndicator(indicator)
[source]Will unregister an indicator and it's associated consolidator instance so they stop receiving data updates
- indicator (IndicatorBase) — The indicator instance to unregister
Handling Data
Handling Data
cik(symbol)
[source]cik(cik, trading_date=None)
[source]Converts a CIK identifier into String) array
- cik (int) — The CIK identifier of an asset
- trading_date (datetime, optional) — The date that the stock being looked up iswas 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.
Symbols corresponding to the CIK. If no Symbol with a matching CIK was found, returns empty array.
CIK(symbol)
[source]CIK(cik, tradingDate=None)
[source]Converts a CIK identifier into String) array
- cik (Int32) — The CIK identifier of an asset
- tradingDate (DateTime, optional) — The date that the stock being looked up iswas 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.
Symbols corresponding to the CIK. If no Symbol with a matching CIK was found, returns empty array.
composite_figi(composite_figi, trading_date=None)
[source]Converts a composite FIGI identifier into a String)
- composite_figi (str) — The composite Financial Instrument Global Identifier (FIGI) of an asset
- trading_date (datetime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the composite FIGI. If no Symbol with a matching composite FIGI was found, returns null.
composite_figi(symbol)
[source]cusip(cusip, trading_date=None)
[source]Converts a CUSIP identifier into a String)
- cusip (str) — The CUSIP number of an asset
- trading_date (datetime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the CUSIP. If no Symbol with a matching CUSIP was found, returns null.
cusip(symbol)
[source]CUSIP(cusip, tradingDate=None)
[source]Converts a CUSIP identifier into a String)
- cusip (string) — The CUSIP number of an asset
- tradingDate (DateTime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the CUSIP. If no Symbol with a matching CUSIP was found, returns null.
CUSIP(symbol)
[source]fundamentals(symbol)
[source]Get the fundamental data for the requested symbol at the current time
- symbol (Symbol)
The fundamental data for the Symbol
fundamentals(symbols)
[source]Get the fundamental data for the requested symbol at the current time
- symbols (List[Symbol])
The fundamental data for the symbols
List[Fundamental]
Fundamentals(symbol)
[source]Get the fundamental data for the requested symbol at the current time
- symbol (Symbol)
The fundamental data for the Symbol
Fundamentals(symbols)
[source]Get the fundamental data for the requested symbol at the current time
- symbols (List<Symbol>)
The fundamental data for the symbols
List[Fundamental]
isin(isin, trading_date=None)
[source]Converts an ISIN identifier into a String)
- isin (str) — The International Securities Identification Number (ISIN) of an asset
- trading_date (datetime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the ISIN. If no Symbol with a matching ISIN was found, returns null.
isin(symbol)
[source]ISIN(isin, tradingDate=None)
[source]Converts an ISIN identifier into a String)
- isin (string) — The International Securities Identification Number (ISIN) of an asset
- tradingDate (DateTime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the ISIN. If no Symbol with a matching ISIN was found, returns null.
ISIN(symbol)
[source]on_data(slice)
[source]Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event
- slice (Slice) — The current slice of data keyed by symbol string
OnData(slice)
[source]Event - v3.0 DATA EVENT HANDLER: (Pattern) Basic template for user to override for receiving all subscription data in a single event
- slice (Slice) — The current slice of data keyed by symbol string
on_delistings(delistings)
[source]Event handler to be called when there's been a delistings event
- delistings (Delistings) — The current time slice delistings
OnDelistings(delistings)
[source]Event handler to be called when there's been a delistings event
- delistings (Delistings) — The current time slice delistings
on_dividends(dividends)
[source]Event handler to be called when there's been a dividend event
- dividends (Dividends) — The current time slice dividends
OnDividends(dividends)
[source]Event handler to be called when there's been a dividend event
- dividends (Dividends) — The current time slice dividends
on_end_of_algorithm()
[source]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.
OnEndOfAlgorithm()
[source]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.
on_end_of_day(symbol)
[source]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).
- symbol (Symbol | str) — Asset symbol for this end of day event. Forex and equities have different closing hours.
OnEndOfDay(symbol)
[source]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).
- symbol (String | Symbol) — Asset symbol for this end of day event. Forex and equities have different closing hours.
on_end_of_time_step()
[source]Invoked at the end of every time step. This allows the algorithm to process events before advancing to the next time step.
OnEndOfTimeStep()
[source]Invoked at the end of every time step. This allows the algorithm to process events before advancing to the next time step.
on_splits(splits)
[source]Event handler to be called when there's been a split event
- splits (Splits) — The current time slice splits
OnSplits(splits)
[source]Event handler to be called when there's been a split event
- splits (Splits) — The current time slice splits
on_symbol_changed_events(symbols_changed)
[source]Event handler to be called when there's been a symbol changed event
- symbols_changed (SymbolChangedEvents) — The current time slice symbol changed events
OnSymbolChangedEvents(symbolsChanged)
[source]Event handler to be called when there's been a symbol changed event
- symbolsChanged (SymbolChangedEvents) — The current time slice symbol changed events
on_warmup_finished()
[source]Called when the algorithm has completed initialization and warm up.
OnWarmupFinished()
[source]Called when the algorithm has completed initialization and warm up.
sedol(sedol, trading_date=None)
[source]Converts a SEDOL identifier into a String)
- sedol (str) — The SEDOL identifier of an asset
- trading_date (datetime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the SEDOL. If no Symbol with a matching SEDOL was found, returns null.
sedol(symbol)
[source]SEDOL(sedol, tradingDate=None)
[source]Converts a SEDOL identifier into a String)
- sedol (string) — The SEDOL identifier of an asset
- tradingDate (DateTime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the SEDOL. If no Symbol with a matching SEDOL was found, returns null.
SEDOL(symbol)
[source]set_algorithm_id(algorithm_id)
[source]Set the algorithm id (backtestId or live deployId for the algorithm).
- algorithm_id (str) — String Algorithm Id
SetAlgorithmId(algorithmId)
[source]Set the algorithm id (backtestId or live deployId for the algorithm).
- algorithmId (string) — String Algorithm Id
set_api(api)
[source]Provide the API for the algorithm.
- api (IApi) — Initiated API
SetApi(api)
[source]Provide the API for the algorithm.
- api (IApi) — Initiated API
set_available_data_types(available_data_types)
[source]Set the available data feeds in the SecurityManager
- available_data_types (Dict[SecurityType, List[TickType]]) — supports
SetAvailableDataTypes(availableDataTypes)
[source]Set the available data feeds in the SecurityManager
- availableDataTypes (Dictionary<SecurityType, List<TickType>>) — supports
set_current_slice(slice)
[source]set_date_time(frontier)
[source]Update the internal algorithm time frontier.
- frontier (datetime) — Current utc datetime.
SetDateTime(frontier)
[source]Update the internal algorithm time frontier.
- frontier (DateTime) — Current utc datetime.
set_end_date(year, month, day)
[source]Set the end date for a backtest run
- year (int) — Int end date 1-30
- month (int) — Int month end date
- day (int) — Int year end date
set_end_date(end)
[source]Set the end date for a backtest run
- end (datetime) — Datetime value for end date
SetEndDate(year, month, day)
[source]Set the end date for a backtest run
- year (Int32) — Int end date 1-30
- month (Int32) — Int month end date
- day (Int32) — Int year end date
SetEndDate(end)
[source]Set the end date for a backtest run
- end (DateTime) — Datetime value for end date
set_object_store(object_store)
[source]Sets the object store
- object_store (IObjectStore) — The object store
SetObjectStore(objectStore)
[source]Sets the object store
- objectStore (IObjectStore) — The object store
set_run_time_error(exception)
[source]Set the runtime error
- exception (Exception) — Represents error that occur during execution
SetRunTimeError(exception)
[source]Set the runtime error
- exception (Exception) — Represents error that occur during execution
set_start_date(year, month, day)
[source]Set the start date for backtest.
- year (int) — Int starting date 1-30
- month (int) — Int month starting date
- day (int) — Int year starting date
set_start_date(start)
[source]Set the start date for backtest.
- start (datetime) — Datetime Start date for backtest
SetStartDate(year, month, day)
[source]Set the start date for backtest.
- year (Int32) — Int starting date 1-30
- month (Int32) — Int month starting date
- day (Int32) — Int year starting date
SetStartDate(start)
[source]Set the start date for backtest.
- start (DateTime) — Datetime Start date for backtest
set_time_zone(time_zone)
[source]Sets the time zone of the Time property in the algorithm
- time_zone (datetimeZone | str) — The desired time zone
SetTimeZone(timeZone)
[source]Sets the time zone of the Time property in the algorithm
- timeZone (String | DateTimeZone) — The desired time zone
Algorithm Id for this backtest or live algorithm.
Algorithm Id for this backtest or live algorithm.
str
Algorithm Id for this backtest or live algorithm.
Algorithm Id for this backtest or live algorithm.
string
Returns the current Slice object
Returns the current Slice object
Slice
Returns the current Slice object
Returns the current Slice object
Slice
Value of the user set start-date from the backtest. Controls the period of the backtest.
Value of the user set start-date from the backtest. Controls the period of the backtest.
datetime
Value of the user set start-date from the backtest. Controls the period of the backtest.
Value of the user set start-date from the backtest. Controls the period of the backtest.
DateTime
Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting the algorithm-id.
Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting the algorithm-id.
str
Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting the algorithm-id.
Public name for the algorithm as automatically generated by the IDE. Intended for helping distinguish logs by noting the algorithm-id.
string
Gets the object store, used for persistence
Gets the object store, used for persistence
ObjectStore
Gets the object store, used for persistence
Gets the object store, used for persistence
ObjectStore
Gets the user settings for the algorithm
Gets the user settings for the algorithm
IAlgorithmSettings
Gets the user settings for the algorithm
Gets the user settings for the algorithm
IAlgorithmSettings
Value of the user set start-date from the backtest.
Value of the user set start-date from the backtest.
datetime
Value of the user set start-date from the backtest.
Value of the user set start-date from the backtest.
DateTime
Gets or sets the current status of the algorithm
Gets or sets the current status of the algorithm
AlgorithmStatus
Gets or sets the current status of the algorithm
Gets or sets the current status of the algorithm
AlgorithmStatus
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.
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.
SubscriptionManager
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.
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.
SubscriptionManager
A list of tags associated with the algorithm or the backtest, useful for categorization
A list of tags associated with the algorithm or the backtest, useful for categorization
HashSet[str]
A list of tags associated with the algorithm or the backtest, useful for categorization
A list of tags associated with the algorithm or the backtest, useful for categorization
HashSet<String>
Read-only value for current time frontier of the algorithm in terms of the TimeZone
Read-only value for current time frontier of the algorithm in terms of the TimeZone
datetime
Read-only value for current time frontier of the algorithm in terms of the TimeZone
Read-only value for current time frontier of the algorithm in terms of the TimeZone
DateTime
Gets the time zone used for the Time property. The default value is NewYork
Gets the time zone used for the Time property. The default value is NewYork
datetimeZone
Gets the time zone used for the Time property. The default value is NewYork
Gets the time zone used for the Time property. The default value is NewYork
DateTimeZone
Current date/time in UTC.
Current date/time in UTC.
datetime
Current date/time in UTC.
Current date/time in UTC.
DateTime
CompositeFIGI(compositeFigi, tradingDate=None)
[source]Converts a composite FIGI identifier into a String)
- compositeFigi (string) — The composite Financial Instrument Global Identifier (FIGI) of an asset
- tradingDate (DateTime, optional) — The date that the stock being looked up iswas 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.
Symbol corresponding to the composite FIGI. If no Symbol with a matching composite FIGI was found, returns null.
Historical Data
Historical Data
history(universe, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[BaseDataCollection]
history(universe, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing data over the most recent span for all configured securities
List[BaseDataCollection]
history(universe, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- span (timedelta) — The span over which to request data. This is a calendar span, so take into consideration weekends and such
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[BaseDataCollection]
history(symbols, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbols, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbols, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbols, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[Slice]
history(symbols, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[Slice]
history(symbols, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbols (List[Symbol]) — The symbols to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[Slice]
history(request)
[source]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.
- request (HistoryRequest) — the history request to execute
An enumerable of slice satisfying the specified history request
List[Slice]
history(requests)
[source]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.
- requests (List[HistoryRequest]) — the history requests to execute
An enumerable of slice satisfying the specified history request
List[Slice]
history(symbol, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbol, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbol, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
history(symbol, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[TradeBar]
history(symbol, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[TradeBar]
history(symbol, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
List[TradeBar]
history(type, symbol, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
history(type, tickers, start, end, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- start (datetime) — The start time in the algorithm's time zone
- end (datetime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
history(type, symbol, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
history(type, symbol, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
history(type, tickers, periods, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- periods (int) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
history(type, tickers, span, resolution=None, fill_forward=None, extended_market_hours=None, data_mapping_mode=None, data_normalization_mode=None, contract_depth_offset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- span (timedelta) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fill_forward (bool, optional) — True to fill forward missing data, false otherwise
- extended_market_hours (bool, optional) — True to include extended market hours data, false otherwise
- data_mapping_mode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- data_normalization_mode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contract_depth_offset (int, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(universe, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[BaseDataCollection]
History(universe, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing data over the most recent span for all configured securities
IEnumerable[BaseDataCollection]
History(universe, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- universe (Universe) — The universe to fetch the data for
- span (TimeSpan) — The span over which to request data. This is a calendar span, so take into consideration weekends and such
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[BaseDataCollection]
History(symbols, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbols, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbols, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbols, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[Slice]
History(symbols, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[Slice]
History(symbols, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbols (List<Symbol>) — The symbols to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[Slice]
History(request)
[source]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.
- request (HistoryRequest) — the history request to execute
An enumerable of slice satisfying the specified history request
IEnumerable[Slice]
History(requests)
[source]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.
- requests (List<HistoryRequest>) — the history requests to execute
An enumerable of slice satisfying the specified history request
IEnumerable[Slice]
History(symbol, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbol, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbol, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
History(symbol, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[TradeBar]
History(symbol, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[TradeBar]
History(symbol, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- symbol (Symbol) — The symbol to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
An enumerable of slice containing the requested historical data
IEnumerable[TradeBar]
History(type, symbol, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(type, tickers, start, end, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- start (DateTime) — The start time in the algorithm's time zone
- end (DateTime) — The end time in the algorithm's time zone
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(type, symbol, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(type, symbol, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- symbol (Symbol) — The symbol to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(type, tickers, periods, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- periods (Int32) — The number of bars to request
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
History(type, tickers, span, resolution=None, fillForward=None, extendedMarketHours=None, dataMappingMode=None, dataNormalizationMode=None, contractDepthOffset=None)
[source]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.
- type (PyObject) — The data type of the symbols
- tickers (PyObject) — The symbols to retrieve historical data for
- span (TimeSpan) — The span over which to retrieve recent historical data
- resolution (Resolution, optional) — The resolution to request
- fillForward (Boolean, optional) — True to fill forward missing data, false otherwise
- extendedMarketHours (Boolean, optional) — True to include extended market hours data, false otherwise
- dataMappingMode (DataMappingMode, optional) — The contract mapping mode to use for the security history request
- dataNormalizationMode (DataNormalizationMode, optional) — The price scaling mode to use for the securities history
- contractDepthOffset (Int32, optional) — The continuous contract desired offset from the current front month. For example, 0 will use the front month, 1 will use the back month contract
pandas.DataFrame containing the requested historical data
PyObject
set_finished_warming_up()
[source]Sets IsWarmingUp to false to indicate this algorithm has finished its warm up
SetFinishedWarmingUp()
[source]Sets IsWarmingUp to false to indicate this algorithm has finished its warm up
set_history_provider(history_provider)
[source]Set the historical data provider
- history_provider (IHistoryProvider) — Historical data provider
SetHistoryProvider(historyProvider)
[source]Set the historical data provider
- historyProvider (IHistoryProvider) — Historical data provider
set_warm_up(time_span, resolution)
[source]Sets the warm up period to the specified value
- time_span (timedelta) — The amount of time to warm up, this does not take into account market hoursweekends
- resolution (Resolution) — The resolution to request
set_warm_up(bar_count, resolution)
[source]Sets the warm up period to the specified value
- bar_count (int) — The number of data points requested for warm up
- resolution (Resolution) — The resolution to request
SetWarmUp(timeSpan, resolution)
[source]Sets the warm up period to the specified value
- timeSpan (TimeSpan) — The amount of time to warm up, this does not take into account market hoursweekends
- resolution (Resolution) — The resolution to request
SetWarmUp(barCount, resolution)
[source]Sets the warm up period to the specified value
- barCount (Int32) — The number of data points requested for warm up
- resolution (Resolution) — The resolution to request
set_warmup(time_span, resolution)
[source]Sets the warm up period to the specified value
- time_span (timedelta) — The amount of time to warm up, this does not take into account market hoursweekends
- resolution (Resolution) — The resolution to request
set_warmup(bar_count, resolution)
[source]Sets the warm up period to the specified value
- bar_count (int) — The number of data points requested for warm up
- resolution (Resolution) — The resolution to request
SetWarmup(timeSpan, resolution)
[source]Sets the warm up period to the specified value
- timeSpan (TimeSpan) — The amount of time to warm up, this does not take into account market hoursweekends
- resolution (Resolution) — The resolution to request
SetWarmup(barCount, resolution)
[source]Sets the warm up period to the specified value
- barCount (Int32) — The number of data points requested for warm up
- resolution (Resolution) — The resolution to request
Gets whether or not this algorithm is still warming up
Gets whether or not this algorithm is still warming up
bool
Gets whether or not this algorithm is still warming up
Gets whether or not this algorithm is still warming up
bool
Indicators
Indicators
a(target, reference, alpha_period=1, beta_period=252, resolution=None, risk_free_rate=None, selector=None)
[source]Adds a tag to the algorithm
- target (Symbol) — The target symbol whose Alpha value we want
- reference (Symbol) — The reference symbol to compare with the target symbol
- alpha_period (int, optional) — The period of the Alpha indicator
- beta_period (int, optional) — The period of the Beta indicator
- resolution (Resolution, optional) — The resolution
- risk_free_rate (float, optional) — The risk free rate
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Alpha indicator for the given parameters
A(target, reference, alphaPeriod=1, betaPeriod=252, resolution=None, riskFreeRate=None, selector=None)
[source]Adds a tag to the algorithm
- target (Symbol) — The target symbol whose Alpha value we want
- reference (Symbol) — The reference symbol to compare with the target symbol
- alphaPeriod (Int32, optional) — The period of the Alpha indicator
- betaPeriod (Int32, optional) — The period of the Beta indicator
- resolution (Resolution, optional) — The resolution
- riskFreeRate (decimal, optional) — The risk free rate
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Alpha indicator for the given parameters
abands(symbol, period, width=4.0, moving_average_type=0, resolution=None, selector=None)
[source]Creates a new Acceleration Bands indicator.
- symbol (Symbol) — The symbol whose Acceleration Bands we want.
- period (int) — The period of the three moving average (middle, upper and lower band).
- width (float, optional) — A coefficient specifying the distance between the middle band and upper or lower bands.
- moving_average_type (MovingAverageType, optional) — Type of the moving average.
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.
ABANDS(symbol, period, width=4.0, movingAverageType=0, resolution=None, selector=None)
[source]Creates a new Acceleration Bands indicator.
- symbol (Symbol) — The symbol whose Acceleration Bands we want.
- period (Int32) — The period of the three moving average (middle, upper and lower band).
- width (decimal, optional) — A coefficient specifying the distance between the middle band and upper or lower bands.
- movingAverageType (MovingAverageType, optional) — Type of the moving average.
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar.
ad(symbol, resolution=None, selector=None)
[source]Creates a new AccumulationDistribution indicator.
- symbol (Symbol) — The symbol whose AD we want
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — x.Value)
The AccumulationDistribution indicator for the requested symbol over the specified period
AD(symbol, resolution=None, selector=None)
[source]Creates a new AccumulationDistribution indicator.
- symbol (Symbol) — The symbol whose AD we want
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — x.Value)
The AccumulationDistribution indicator for the requested symbol over the specified period
addiff(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Difference indicator
- symbols (List[Symbol]) — The symbols whose AD Difference we want
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Difference indicator for the requested symbol over the specified period
ADDIFF(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Difference indicator
- symbols (List<Symbol>) — The symbols whose AD Difference we want
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Difference indicator for the requested symbol over the specified period
adosc(symbol, fast_period, slow_period, resolution=None, selector=None)
[source]Creates a new AccumulationDistributionOscillator indicator.
- symbol (Symbol) — The symbol whose ADOSC we want
- fast_period (int) — The fast moving average period
- slow_period (int) — The slow moving average period
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — x.Value)
The AccumulationDistributionOscillator indicator for the requested symbol over the specified period
ADOSC(symbol, fastPeriod, slowPeriod, resolution=None, selector=None)
[source]Creates a new AccumulationDistributionOscillator indicator.
- symbol (Symbol) — The symbol whose ADOSC we want
- fastPeriod (Int32) — The fast moving average period
- slowPeriod (Int32) — The slow moving average period
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — x.Value)
The AccumulationDistributionOscillator indicator for the requested symbol over the specified period
adr(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Ratio indicator
- symbols (List[Symbol]) — The symbols whose AD Ratio we want
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Ratio indicator for the requested symbol over the specified period
ADR(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Ratio indicator
- symbols (List<Symbol>) — The symbols whose AD Ratio we want
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Ratio indicator for the requested symbol over the specified period
advr(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Volume Ratio indicator
- symbols (List[Symbol]) — The symbol whose AD Volume Rate we want
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Volume Ratio indicator for the requested symbol over the specified period
ADVR(symbols, resolution=None, selector=None)
[source]Creates a new Advance/Decline Volume Ratio indicator
- symbols (List<Symbol>) — The symbol whose AD Volume Rate we want
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The AdvanceDecline Volume Ratio indicator for the requested symbol over the specified period
adx(symbol, period, resolution=None, selector=None)
[source]Creates a new Average Directional Index indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Average Directional Index we seek
- period (int) — The resolution.
- resolution (Resolution, optional) — The period over which to compute the Average Directional Index
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Average Directional Index indicator for the requested symbol.
ADX(symbol, period, resolution=None, selector=None)
[source]Creates a new Average Directional Index indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Average Directional Index we seek
- period (Int32) — The resolution.
- resolution (Resolution, optional) — The period over which to compute the Average Directional Index
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Average Directional Index indicator for the requested symbol.
adxr(symbol, period, resolution=None, selector=None)
[source]Creates a new AverageDirectionalMovementIndexRating indicator.
- symbol (Symbol) — The symbol whose ADXR we want
- period (int) — The period over which to compute the ADXR
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, IBaseDataBar], optional) — x.Value)
The AverageDirectionalMovementIndexRating indicator for the requested symbol over the specified period
ADXR(symbol, period, resolution=None, selector=None)
[source]Creates a new AverageDirectionalMovementIndexRating indicator.
- symbol (Symbol) — The symbol whose ADXR we want
- period (Int32) — The period over which to compute the ADXR
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, IBaseDataBar>, optional) — x.Value)
The AverageDirectionalMovementIndexRating indicator for the requested symbol over the specified period
alma(symbol, period, sigma=6, offset=0.85, resolution=None, selector=None)
[source]Creates a new ArnaudLegouxMovingAverage indicator.
- symbol (Symbol) — The symbol whose ALMA we want
- period (int) — int - the number of periods to calculate the ALMA
- sigma (int, optional) — int - this parameter is responsible for the shape of the curve coefficients.
- offset (float, optional) — decimal - This parameter allows regulating the smoothness and high sensitivity of the Moving Average. The range for this parameter is [0, 1].
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The ArnaudLegouxMovingAverage indicator for the requested symbol over the specified period
ALMA(symbol, period, sigma=6, offset=0.85, resolution=None, selector=None)
[source]Creates a new ArnaudLegouxMovingAverage indicator.
- symbol (Symbol) — The symbol whose ALMA we want
- period (Int32) — int - the number of periods to calculate the ALMA
- sigma (Int32, optional) — int - this parameter is responsible for the shape of the curve coefficients.
- offset (decimal, optional) — decimal - This parameter allows regulating the smoothness and high sensitivity of the Moving Average. The range for this parameter is [0, 1].
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The ArnaudLegouxMovingAverage indicator for the requested symbol over the specified period
ao(symbol, fast_period, slow_period, type, resolution=None, selector=None)
[source]Creates a new Awesome Oscillator from the specified periods.
- symbol (Symbol) — The symbol whose Awesome Oscillator we seek
- fast_period (int) — The resolution.
- slow_period (int) — The period of the fast moving average associated with the AO
- type (MovingAverageType) — The period of the slow moving average associated with the AO
- resolution (Resolution, optional) — The type of moving average used when computing the fast and slow term. Defaults to simple moving average.
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
AO(symbol, fastPeriod, slowPeriod, type, resolution=None, selector=None)
[source]Creates a new Awesome Oscillator from the specified periods.
- symbol (Symbol) — The symbol whose Awesome Oscillator we seek
- fastPeriod (Int32) — The resolution.
- slowPeriod (Int32) — The period of the fast moving average associated with the AO
- type (MovingAverageType) — The period of the slow moving average associated with the AO
- resolution (Resolution, optional) — The type of moving average used when computing the fast and slow term. Defaults to simple moving average.
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
apo(symbol, fast_period, slow_period, moving_average_type, resolution=None, selector=None)
[source]Creates a new AbsolutePriceOscillator indicator.
- symbol (Symbol) — The symbol whose APO we want
- fast_period (int) — The fast moving average period
- slow_period (int) — The slow moving average period
- moving_average_type (MovingAverageType) — The type of moving average to use
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The AbsolutePriceOscillator indicator for the requested symbol over the specified period
APO(symbol, fastPeriod, slowPeriod, movingAverageType, resolution=None, selector=None)
[source]Creates a new AbsolutePriceOscillator indicator.
- symbol (Symbol) — The symbol whose APO we want
- fastPeriod (Int32) — The fast moving average period
- slowPeriod (Int32) — The slow moving average period
- movingAverageType (MovingAverageType) — The type of moving average to use
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The AbsolutePriceOscillator indicator for the requested symbol over the specified period
aps(symbol, period=3, resolution=None, selector=None)
[source]Creates an AugenPriceSpike indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose APS we want
- period (int, optional) — The period of the APS
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The AugenPriceSpike indicator for the given parameters
APS(symbol, period=3, resolution=None, selector=None)
[source]Creates an AugenPriceSpike indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose APS we want
- period (Int32, optional) — The period of the APS
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The AugenPriceSpike indicator for the given parameters
ar(symbol, period, resolution=None, selector=None)
[source]Creates a new Average Range (AR) indicator.
- symbol (Symbol) — The symbol whose Average Range we want to calculate
- period (int) — The period over which to compute the Average Range
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — x.Value).
The Average Range indicator for the requested symbol over the specified period
AR(symbol, period, resolution=None, selector=None)
[source]Creates a new Average Range (AR) indicator.
- symbol (Symbol) — The symbol whose Average Range we want to calculate
- period (Int32) — The period over which to compute the Average Range
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — x.Value).
The Average Range indicator for the requested symbol over the specified period
arima(symbol, ar_order, diff_order, ma_order, period, resolution=None, selector=None)
[source]Creates a new ARIMA indicator.
- symbol (Symbol) — The symbol whose ARIMA indicator we want
- ar_order (int) — AR order (p) -- defines the number of past values to consider in the AR component of the model.
- diff_order (int) — Difference order (d) -- defines how many times to difference the model before fitting parameters.
- ma_order (int) — MA order (q) -- defines the number of past values to consider in the MA component of the model.
- period (int) — Size of the rolling series to fit onto
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The ARIMA indicator for the requested symbol over the specified period
ARIMA(symbol, arOrder, diffOrder, maOrder, period, resolution=None, selector=None)
[source]Creates a new ARIMA indicator.
- symbol (Symbol) — The symbol whose ARIMA indicator we want
- arOrder (Int32) — AR order (p) -- defines the number of past values to consider in the AR component of the model.
- diffOrder (Int32) — Difference order (d) -- defines how many times to difference the model before fitting parameters.
- maOrder (Int32) — MA order (q) -- defines the number of past values to consider in the MA component of the model.
- period (Int32) — Size of the rolling series to fit onto
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The ARIMA indicator for the requested symbol over the specified period
aroon(symbol, up_period, down_period, resolution=None, selector=None)
[source]Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)
- symbol (Symbol) — The symbol whose Aroon we seek
- up_period (int) — The look back period for computing number of periods since maximum
- down_period (int) — The look back period for computing number of periods since minimum
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
An AroonOscillator configured with the specified periods
aroon(symbol, period, resolution=None, selector=None)
[source]Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)
- symbol (Symbol) — The symbol whose Aroon we seek
- period (int) — The look back period for computing number of periods since maximum and minimum
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
An AroonOscillator configured with the specified periods
AROON(symbol, upPeriod, downPeriod, resolution=None, selector=None)
[source]Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)
- symbol (Symbol) — The symbol whose Aroon we seek
- upPeriod (Int32) — The look back period for computing number of periods since maximum
- downPeriod (Int32) — The look back period for computing number of periods since minimum
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
An AroonOscillator configured with the specified periods
AROON(symbol, period, resolution=None, selector=None)
[source]Creates a new AroonOscillator indicator which will compute the AroonUp and AroonDown (as well as the delta)
- symbol (Symbol) — The symbol whose Aroon we seek
- period (Int32) — The look back period for computing number of periods since maximum and minimum
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
An AroonOscillator configured with the specified periods
asi(symbol, limit_move, resolution=4, selector=None)
[source]Creates a Wilder Accumulative Swing Index (ASI) indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ASI we want
- limit_move (float) — The maximum daily change in price for the ASI
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The WilderAccumulativeSwingIndex for the given parameters
ASI(symbol, limitMove, resolution=4, selector=None)
[source]Creates a Wilder Accumulative Swing Index (ASI) indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ASI we want
- limitMove (decimal) — The maximum daily change in price for the ASI
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The WilderAccumulativeSwingIndex for the given parameters
atr(symbol, period, type=0, resolution=None, selector=None)
[source]Creates a new AverageTrueRange indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ATR we want
- period (int) — The smoothing period used to smooth the computed TrueRange values
- type (MovingAverageType, optional) — The type of smoothing to use
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new AverageTrueRange indicator with the specified smoothing type and period
ATR(symbol, period, type=0, resolution=None, selector=None)
[source]Creates a new AverageTrueRange indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ATR we want
- period (Int32) — The smoothing period used to smooth the computed TrueRange values
- type (MovingAverageType, optional) — The type of smoothing to use
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new AverageTrueRange indicator with the specified smoothing type and period
b(target, reference, period, resolution=None, selector=None)
[source]Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation
- target (Symbol) — The target symbol whose Beta value we want
- reference (Symbol) — The reference symbol to compare with the target symbol
- period (int) — The period of the Beta indicator
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Beta indicator for the given parameters
B(target, reference, period, resolution=None, selector=None)
[source]Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation
- target (Symbol) — The target symbol whose Beta value we want
- reference (Symbol) — The reference symbol to compare with the target symbol
- period (Int32) — The period of the Beta indicator
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Beta indicator for the given parameters
bb(symbol, period, k, moving_average_type=0, resolution=None, selector=None)
[source]Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation
- symbol (Symbol) — The symbol whose BollingerBands we seek
- period (int) — The period of the standard deviation and moving average (middle band)
- k (float) — The number of standard deviations specifying the distance between the middle band and upper or lower bands
- moving_average_type (MovingAverageType, optional) — The type of moving average to be used
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
A BollingerBands configured with the specified period
BB(symbol, period, k, movingAverageType=0, resolution=None, selector=None)
[source]Creates a new BollingerBands indicator which will compute the MiddleBand, UpperBand, LowerBand, and StandardDeviation
- symbol (Symbol) — The symbol whose BollingerBands we seek
- period (Int32) — The period of the standard deviation and moving average (middle band)
- k (decimal) — The number of standard deviations specifying the distance between the middle band and upper or lower bands
- movingAverageType (MovingAverageType, optional) — The type of moving average to be used
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
A BollingerBands configured with the specified period
bop(symbol, resolution=None, selector=None)
[source]Creates a new Balance Of Power indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Balance Of Power we seek
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Balance Of Power indicator for the requested symbol.
BOP(symbol, resolution=None, selector=None)
[source]Creates a new Balance Of Power indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Balance Of Power we seek
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Balance Of Power indicator for the requested symbol.
c(target, reference, period, correlation_type=0, resolution=None, selector=None)
[source]Converts a composite FIGI identifier into a String)
- target (Symbol) — The target symbol of this indicator
- reference (Symbol) — The reference symbol of this indicator
- period (int) — The period of this indicator
- correlation_type (CorrelationType, optional) — Correlation type
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Correlation indicator for the given parameters
C(target, reference, period, correlationType=0, resolution=None, selector=None)
[source]Converts a composite FIGI identifier into a String)
- target (Symbol) — The target symbol of this indicator
- reference (Symbol) — The reference symbol of this indicator
- period (Int32) — The period of this indicator
- correlationType (CorrelationType, optional) — Correlation type
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Correlation indicator for the given parameters
cc(symbol, short_roc_period=11, long_roc_period=14, lwma_period=10, resolution=None, selector=None)
[source]Initializes a new instance of the CoppockCurve indicator
- symbol (Symbol) — The symbol whose Coppock Curve we want
- short_roc_period (int, optional) — The period for the short ROC
- long_roc_period (int, optional) — The period for the long ROC
- lwma_period (int, optional) — The period for the LWMA
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Coppock Curve indicator for the requested symbol over the specified period
CC(symbol, shortRocPeriod=11, longRocPeriod=14, lwmaPeriod=10, resolution=None, selector=None)
[source]Initializes a new instance of the CoppockCurve indicator
- symbol (Symbol) — The symbol whose Coppock Curve we want
- shortRocPeriod (Int32, optional) — The period for the short ROC
- longRocPeriod (Int32, optional) — The period for the long ROC
- lwmaPeriod (Int32, optional) — The period for the LWMA
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Coppock Curve indicator for the requested symbol over the specified period
cci(symbol, period, moving_average_type=0, resolution=None, selector=None)
[source]Creates a new CommodityChannelIndex indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose CCI we want
- period (int) — The period over which to compute the CCI
- moving_average_type (MovingAverageType, optional) — The type of moving average to use in computing the typical price average
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The CommodityChannelIndex indicator for the requested symbol over the specified period
CCI(symbol, period, movingAverageType=0, resolution=None, selector=None)
[source]Creates a new CommodityChannelIndex indicator. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose CCI we want
- period (Int32) — The period over which to compute the CCI
- movingAverageType (MovingAverageType, optional) — The type of moving average to use in computing the typical price average
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The CommodityChannelIndex indicator for the requested symbol over the specified period
chop(symbol, period, resolution=None, selector=None)
[source]Creates a new ChoppinessIndex indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose CHOP we want
- period (int) — The input window period used to calculate max high and min low
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new ChoppinessIndex indicator with the window period
CHOP(symbol, period, resolution=None, selector=None)
[source]Creates a new ChoppinessIndex indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose CHOP we want
- period (Int32) — The input window period used to calculate max high and min low
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new ChoppinessIndex indicator with the window period
cks(symbol, atr_period, atr_mult, period, moving_average_type=2, resolution=None, selector=None)
[source]Creates a new Chande Kroll Stop indicator which will compute the short and lower stop. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Chande Kroll Stop we seek.
- atr_period (int) — The period over which to compute the average true range.
- atr_mult (float) — The ATR multiplier to be used to compute stops distance.
- period (int) — The period over which to compute the max of high stop and min of low stop.
- moving_average_type (MovingAverageType, optional) — The resolution.
- resolution (Resolution, optional) — The type of smoothing used to smooth the true range values
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Chande Kroll Stop indicator for the requested symbol.
CKS(symbol, atrPeriod, atrMult, period, movingAverageType=2, resolution=None, selector=None)
[source]Creates a new Chande Kroll Stop indicator which will compute the short and lower stop. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose Chande Kroll Stop we seek.
- atrPeriod (Int32) — The period over which to compute the average true range.
- atrMult (decimal) — The ATR multiplier to be used to compute stops distance.
- period (Int32) — The period over which to compute the max of high stop and min of low stop.
- movingAverageType (MovingAverageType, optional) — The resolution.
- resolution (Resolution, optional) — The type of smoothing used to smooth the true range values
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Chande Kroll Stop indicator for the requested symbol.
cmf(symbol, period, resolution=None, selector=None)
[source]Creates a new ChaikinMoneyFlow indicator.
- symbol (Symbol) — The symbol whose CMF we want
- period (int) — The period over which to compute the CMF
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The ChaikinMoneyFlow indicator for the requested symbol over the specified period
CMF(symbol, period, resolution=None, selector=None)
[source]Creates a new ChaikinMoneyFlow indicator.
- symbol (Symbol) — The symbol whose CMF we want
- period (Int32) — The period over which to compute the CMF
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The ChaikinMoneyFlow indicator for the requested symbol over the specified period
cmo(symbol, period, resolution=None, selector=None)
[source]Creates a new ChandeMomentumOscillator indicator.
- symbol (Symbol) — The symbol whose CMO we want
- period (int) — The period over which to compute the CMO
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The ChandeMomentumOscillator indicator for the requested symbol over the specified period
CMO(symbol, period, resolution=None, selector=None)
[source]Creates a new ChandeMomentumOscillator indicator.
- symbol (Symbol) — The symbol whose CMO we want
- period (Int32) — The period over which to compute the CMO
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The ChandeMomentumOscillator indicator for the requested symbol over the specified period
create_indicator_name(symbol, type, resolution)
[source]Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)
- symbol (Symbol) — The symbol this indicator is registered to
- type (Formattablestr | str) — The indicator type, for example, 'SMA(5)'
- resolution (Resolution) — The resolution requested
A unique for the given parameters
str
CreateIndicatorName(symbol, type, resolution)
[source]Creates a new name for an indicator created with the convenience functions (SMA, EMA, ect...)
- symbol (Symbol) — The symbol this indicator is registered to
- type (String | FormattableString) — The indicator type, for example, 'SMA(5)'
- resolution (Resolution) — The resolution requested
A unique for the given parameters
String
d(symbol, mirror_option=None, risk_free_rate=None, dividend_yield=None, option_model=None, iv_model=None, resolution=None)
[source]Send a debug message to the web console:
- symbol (Symbol) — The option symbol whose values we want as an indicator
- mirror_option (Symbol, optional) — The mirror option for parity calculation
- risk_free_rate (float, optional) — The risk free rate
- dividend_yield (float, optional) — The dividend yield
- option_model (OptionPricingModelType, optional) — The option pricing model used to estimate Delta
- iv_model (OptionPricingModelType, optional) — The option pricing model used to estimate IV
- resolution (Resolution, optional) — The desired resolution of the data
A new Delta indicator for the specified symbol
D(symbol, mirrorOption=None, riskFreeRate=None, dividendYield=None, optionModel=None, ivModel=None, resolution=None)
[source]Send a debug message to the web console:
- symbol (Symbol) — The option symbol whose values we want as an indicator
- mirrorOption (Symbol, optional) — The mirror option for parity calculation
- riskFreeRate (decimal, optional) — The risk free rate
- dividendYield (decimal, optional) — The dividend yield
- optionModel (OptionPricingModelType, optional) — The option pricing model used to estimate Delta
- ivModel (OptionPricingModelType, optional) — The option pricing model used to estimate IV
- resolution (Resolution, optional) — The desired resolution of the data
A new Delta indicator for the specified symbol
dch(symbol, upper_period, lower_period, resolution=None, selector=None)
[source]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.
- symbol (Symbol) — The symbol whose Donchian Channel we seek.
- upper_period (int) — The period over which to compute the upper Donchian Channel.
- lower_period (int) — The period over which to compute the lower Donchian Channel.
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Donchian Channel indicator for the requested symbol.
dch(symbol, period, resolution=None, selector=None)
[source]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.
- symbol (Symbol) — The symbol whose Donchian Channel we seek.
- period (int) — The period over which to compute the Donchian Channel.
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, IBaseDataBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Donchian Channel indicator for the requested symbol.
DCH(symbol, upperPeriod, lowerPeriod, resolution=None, selector=None)
[source]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.
- symbol (Symbol) — The symbol whose Donchian Channel we seek.
- upperPeriod (Int32) — The period over which to compute the upper Donchian Channel.
- lowerPeriod (Int32) — The period over which to compute the lower Donchian Channel.
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Donchian Channel indicator for the requested symbol.
DCH(symbol, period, resolution=None, selector=None)
[source]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.
- symbol (Symbol) — The symbol whose Donchian Channel we seek.
- period (Int32) — The period over which to compute the Donchian Channel.
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, IBaseDataBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The Donchian Channel indicator for the requested symbol.
dem(symbol, period, type, resolution=None, selector=None)
[source]Creates a new DeMarker Indicator (DEM), an oscillator-type indicator measuring changes in terms of an asset's High and Low tradebar values.
- symbol (Symbol) — The symbol whose DEM we seek.
- period (int) — The period of the moving average implemented
- type (MovingAverageType) — Specifies the type of moving average to be used
- resolution (Resolution, optional) — The resolution.
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The DeMarker indicator for the requested symbol.
DEM(symbol, period, type, resolution=None, selector=None)
[source]Creates a new DeMarker Indicator (DEM), an oscillator-type indicator measuring changes in terms of an asset's High and Low tradebar values.
- symbol (Symbol) — The symbol whose DEM we seek.
- period (Int32) — The period of the moving average implemented
- type (MovingAverageType) — Specifies the type of moving average to be used
- resolution (Resolution, optional) — The resolution.
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The DeMarker indicator for the requested symbol.
dema(symbol, period, resolution=None, selector=None)
[source]Creates a new DoubleExponentialMovingAverage indicator.
- symbol (Symbol) — The symbol whose DEMA we want
- period (int) — The period over which to compute the DEMA
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The DoubleExponentialMovingAverage indicator for the requested symbol over the specified period
DEMA(symbol, period, resolution=None, selector=None)
[source]Creates a new DoubleExponentialMovingAverage indicator.
- symbol (Symbol) — The symbol whose DEMA we want
- period (Int32) — The period over which to compute the DEMA
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The DoubleExponentialMovingAverage indicator for the requested symbol over the specified period
do(symbol, rsi_period, smoothing_rsi_period, double_smoothing_rsi_period, signal_line_period, resolution=None, selector=None)
[source]Creates a new DerivativeOscillator indicator.
- symbol (Symbol) — The symbol whose DO we want
- rsi_period (int) — The period over which to compute the RSI
- smoothing_rsi_period (int) — The period over which to compute the smoothing RSI
- double_smoothing_rsi_period (int) — The period over which to compute the double smoothing RSI
- signal_line_period (int) — The period over which to compute the signal line
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
The DerivativeOscillator indicator for the requested symbol over the specified period
DO(symbol, rsiPeriod, smoothingRsiPeriod, doubleSmoothingRsiPeriod, signalLinePeriod, resolution=None, selector=None)
[source]Creates a new DerivativeOscillator indicator.
- symbol (Symbol) — The symbol whose DO we want
- rsiPeriod (Int32) — The period over which to compute the RSI
- smoothingRsiPeriod (Int32) — The period over which to compute the smoothing RSI
- doubleSmoothingRsiPeriod (Int32) — The period over which to compute the double smoothing RSI
- signalLinePeriod (Int32) — The period over which to compute the signal line
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to the Value property of BaseData (x => x.Value)
The DerivativeOscillator indicator for the requested symbol over the specified period
dpo(symbol, period, resolution=None, selector=None)
[source]Creates a new DetrendedPriceOscillator indicator.
- symbol (Symbol) — The symbol whose DPO we want
- period (int) — The period over which to compute the DPO
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
A new registered DetrendedPriceOscillator indicator for the requested symbol over the specified period
DPO(symbol, period, resolution=None, selector=None)
[source]Creates a new DetrendedPriceOscillator indicator.
- symbol (Symbol) — The symbol whose DPO we want
- period (Int32) — The period over which to compute the DPO
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
A new registered DetrendedPriceOscillator indicator for the requested symbol over the specified period
ema(symbol, period, smoothing_factor, resolution=None, selector=None)
[source]Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose EMA we want
- period (int) — The period of the EMA
- smoothing_factor (float) — The percentage of data from the previous value to be carried into the next value
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, float], optional) — x.Value)
The ExponentialMovingAverage for the given parameters
EMA(symbol, period, smoothingFactor, resolution=None, selector=None)
[source]Creates an ExponentialMovingAverage indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose EMA we want
- period (Int32) — The period of the EMA
- smoothingFactor (decimal) — The percentage of data from the previous value to be carried into the next value
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, Decimal>, optional) — x.Value)
The ExponentialMovingAverage for the given parameters
emv(symbol, period=1, scale=10000, resolution=None, selector=None)
[source]Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose EMV we want
- period (int, optional) — The period of the EMV
- scale (int, optional) — The length of the outputed value
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The EaseOfMovementValue indicator for the given parameters
EMV(symbol, period=1, scale=10000, resolution=None, selector=None)
[source]Creates an EaseOfMovementValue indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose EMV we want
- period (Int32, optional) — The period of the EMV
- scale (Int32, optional) — The length of the outputed value
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
The EaseOfMovementValue indicator for the given parameters
fi(symbol, period, type=1, resolution=None, selector=None)
[source]Creates a new ForceIndex indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ForceIndex we want
- period (int) — The smoothing period used to smooth the computed ForceIndex values
- type (MovingAverageType, optional) — The type of smoothing to use
- resolution (Resolution, optional) — The resolution
- selector (Callable[IBaseData, TradeBar], optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new ForceIndex indicator with the specified smoothing type and period
FI(symbol, period, type=1, resolution=None, selector=None)
[source]Creates a new ForceIndex indicator for the symbol. The indicator will be automatically updated on the given resolution.
- symbol (Symbol) — The symbol whose ForceIndex we want
- period (Int32) — The smoothing period used to smooth the computed ForceIndex values
- type (MovingAverageType, optional) — The type of smoothing to use
- resolution (Resolution, optional) — The resolution
- selector (Func<IBaseData, TradeBar>, optional) — Selects a value from the BaseData to send into the indicator, if null defaults to casting the input value to a TradeBar
A new ForceIndex indicator with the specified smoothing type and period
filtered_identity(symbol, resolution, selector=None, filter=None, field_name=None)
[source]Creates a new FilteredIdentity indicator for the symbol The indicator will be automatically updated on the symbol's subscription resolution
- symbol (Symbol) — The symbol whose values we want as an indicator