Hi,
For local development, it's helpful to have some data for backtest debugging. I see there are some examples for options trading, but they usually just have 2 days or so which could be enough in some cases, but not others. So I looked at the 'lean data generate' command. It has an 'Option' security type so I used that to generate some data.
The problem is when you try to use the data, the recommended method in the tutorials for options is to do something like this:
self.equity = self.AddEquity(ticker, Resolution.Minute)
self.option = self.AddOption(ticker, Resolution.Minute)
I assume the equity data is needed so that when you make trades the system will have pricing data for the equity, not just the options. But in this case the randomly generated option data doesn't have equity data to match, so you get an error because the ApiDataProvider can't find this data (because it doesn't exist).
Am I doing something wrong? I tried generating again with both and Equity and an Option '--security-type' switch, which didn't work. Tried with '--security-type Option,Equity', also no go. Is there some way to get the Equity data generated for the same ticker, and hopefully correlated with the options prices?
Jasper van Merle
Hi Jesse,
You're not doing anything wrong, the behavior you're seeing is a limitation of the random data generator. We have an issue for it on GitHub, you can subscribe to that to track our progress on the feature. I completely forgot about that issue, I've just added this limitation to the CLI's documentation as well.
Jesse Pangburn
OK, thanks again Jasper! I subscribed to that issue
Jesse Pangburn
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!