Hello QuantConnect community,
I'm working on an algorithm where I need to handle symbol changes, and I have a question about the on_symbol_changed_events method:
- Is on_symbol_changed_events called once daily by default, typically before market open?
- If my algorithm is set to use minute resolution data, does this affect how often on_symbol_changed_events is called? For instance, would it be called more frequently (e.g., every minute) to check for symbol changes?
Mia Alissi
Hello Andy,
The
on_symbol_changed_events
method is not called once daily by default. Instead, it is triggered when there is a symbol change event. This event handler provides information on ticker changes source.The resolution of your data does not affect how often
on_symbol_changed_events
is called. This is because symbol changes are not tied to the data resolution but are event-driven based on actual changes in the symbol source.Here is an example of how you can use
on_symbol_changed_events
in Python:This method will loop through all the symbol change events and you can add your own logic inside the loop to handle these events.
I hope this helps! Let me know if you have any other questions.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Andy Hu
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!