Back

Questions re: ''Delta-hedged straddle" code / strategy

I am a newbie programmer and am tinkering with your ''Delta-hedged straddle" code / strategy.

1)   I was able to change the starting date and run a simulation that stated in Jan 2010. But no matter when I start a simulation, it stops during 2017...even if I set the date to later than that.

2)  Also, can I run that same code on a different symbol? (like an Oil ETF for example? When I put in 'USO' for the symbol on Line 31, the code would not run...it says 'Runtime Error".)

Update Backtest







0

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.


Hi Tom,

Thanks for writing. We’re happy to hear you’re diving into the example strategies.

Can you please share your backtest? This text editor has a code snippet icon that will let you include the algorithm in your reply.

For your first inquiry, an issue you may be running into is that a symbol ticker changed in 2017.

For your second inquiry, you should be able to run the same code on different symbols, but there are different data types for different assets. If you’re swapping out assets of one data type or another, you would need to change your code. 

You can find more about your two questions here:

https://www.quantconnect.com/docs/key-concepts/security-identifiers#Security-Identifiers-Symbols-vs-Tickers

https://www.quantconnect.com/docs/algorithm-reference/handling-data

Let us know if this is helpful.

Thanks!
Sherry

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed