You can add properties (C# terminology) / attributes (Python terminology) to the Security object. For example, you can add an exponential moving average (link to indicator docs):
In Security Custom Properties, we can use the existing text and code snippet:
If you need to save data or create objects for each security in the universe, add custom members to the respective Security objects. This technique is useful if you want to track stop loss levels or add indicators for each asset in the universe.
def OnSecuritiesChanged(self, changes: SecurityChanges) -> None:
for security in changes.AddedSecurities:
# Create an indicator
security.indicator = self.SMA(security.Symbol, 10)
# Warm up the indicator
self.WarmUpIndicator(security.Symbol, security.indicator)
for security in changes.RemovedSecurities:
self.DeregisterIndicator(security.indicator)
Also, we need to review all Symbol Data pattern and note that we should use it when there is no Security object yet. For example in Example 2.
Actual Behavior
This information is not highlighted.
Checklist
[x] I have completely filled out this template
[x] I have confirmed that this issue exists on the current master branch
[x] I have confirmed that this is not a duplicate issue by searching issues
Expected Behavior
Security > Key Concepts introduces the concept of custom data.
In Universe > Key Concepts, we should change the order to
In Security Custom Properties, we can use the existing text and code snippet:
Also, we need to review all
Symbol Data
pattern and note that we should use it when there is no Security object yet. For example in Example 2.Actual Behavior
This information is not highlighted.
Checklist
master
branch