Securities

Properties

Introduction

Security objects contain the models and properties of an asset.

Security Properties

Security objects have the following properties:

Custom Security Properties

You can add propertiesattributes to the Security object. For example, you can add an exponential moving average.

var equity = AddEquity("SPY");
equity.ema = EMA(equity.Symbol, 10, Resolution.Daily);
equity = self.add_equity("SPY")
equity.ema = self.ema(equity.symbol, 10, Resolution.DAILY)

This feature is helpful because you can get the Security object from the Securitiessecurities object.

var ema = Securities["SPY"].ema.Current.Value;
ema = self.securities["SPY"].ema.current.value

Reality Models

Security objects contain references to the security level reality models. To customize the behavior of each security, configure its reality models.

Symbol Properties

The SymbolPropertiessymbol_properties property of a Security contains properties for a specific security. SymbolProperties objects have the following properties:

To create a SymbolProperties object, call the constructor.

var symbolProperties = new SymbolProperties(description, quoteCurrency, contractMultiplier, minimumPriceVariation, lotSize, marketTicker);
symbol_properties = SymbolProperties(description, quoteCurrency, contractMultiplier, minimumPriceVariation, lotSize, marketTicker)

The following table describes the arguments of the SymbolProperties constructor:

ArgumentData TypeDescriptionDefault Value
descriptionstringstrThe description of the security.
quoteCurrencyquote_currencystringstrThe quote currency of the security.
contractMultipliercontract_multiplierdecimalfloatThe contract multiplier for the security.
minimumPriceVariationminimum_price_variationdecimalfloatThe minimum price variation (tick size) for the security.
lotSizelot_sizedecimalfloatThe lot size (lot size of the order) for the security.
marketTickermarket_tickerstringstrThe market ticker.
minimumOrderSizeminimum_order_sizedecimal?float/NoneTypeThe minimum order size allowed.Nonenull
priceMagnifierprice_magnifierdecimalfloatThis property allows normalizing live asset prices to US Dollars for Lean consumption. In some exchanges, for some securities, data is expressed in cents like corn Futures ('ZC').1

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: