Hi,
I want to chain two universes, in this case an ETF universe for SPY and an option universe for SPY. What I want is to buy SPY options to protect me from the losses of the SPY constituents, I prefer to buy SPY options as buying options for each constituent would be very expensive.
In the documentation I read:
You can combine ("chain") universes together to fetch fundamental and alternative data on a specific subset of assets. Universes filter input data and return Symbol objects. The only requirement is that Symbol objects the filter returns are a subset of the input data. The source of the Symbol objects is unrestricted, so you can feed the output of one universe into another.
I tried to chain my two universes but I just get orders for the options.. This must be because its a different subset of assets. Is there any other way to chain this two universes?
Thanks in advance for the help.
Mia Alissi
From the provided code, it seems like 'Renata' is trying to chain an ETF universe and an options universe. However, as per the information provided in the extracts, chaining universes requires that the Symbol objects returned by the filter are a subset of the input data. In this case, the ETF universe and the options universe are not subsets of each other, which is why 'Renata' is only getting orders for the options.
However, 'Renata' can still use both universes in her algorithm, she just can't chain them in the way she's trying to. She can create an ETF universe to select the SPY constituents and an options universe to select the SPY options. Then, in her
OnData
method, she can implement her trading logic to buy SPY options when certain conditions are met.Here is an example of how to create an ETF universe and an options universe:
In the
OnData
method, 'Renata' can then implement her trading logic to buy SPY options when certain conditions are met. For example:Please note that this is just a basic example and 'Renata' will need to implement her own filter and trading logic.
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.
Renata
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!