Securities
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.AddEquity("SPY") equity.ema = self.EMA(equity.Symbol, 10, Resolution.Daily)
This feature is helpful because you can get the Security
object from the Securities
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 SymbolProperties
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:
Argument | Data Type | Description | Default Value |
---|---|---|---|
description | string str | The description of the security. | |
quoteCurrency | string str | The quote currency of the security. | |
contractMultiplier | decimal float | The contract multiplier for the security. | |
minimumPriceVariation | decimal float | The minimum price variation (tick size) for the security. | |
lotSize | decimal float | The lot size (lot size of the order) for the security. | |
marketTicker | string str | The market ticker. | |
minimumOrderSize | decimal? float/NoneType | The minimum order size allowed. | None null |
priceMagnifier | decimal float | This 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 |