I have got historical data for the index options. Now I am looking at backtesting some of my strategies with this historical data. I would like to backtest strategies like selling a straddle and adjusting it based on movement in the underlying (index).

My Questions

Which library/framework is best suited for it (zipline ,backtrader,etc) or any other. I looked at the documentation of some of these libraries but didn't find a way to work with multi-legged strategies.

I am not looking for a web-based solution as I will be testing some complex multilegged strategies which are not possible on online platforms.

Is there any good library/framework available for multilegged options strategies ? or I have to build my own. If I have to build then could you lay some path on how to approach it.

I have researched a lot on this topic but didn't find anything helpful so thought why not ask in the community.

  • $\begingroup$ A very warm welcome to Quant.SE... does this help: blog.ephorie.de/backtesting-options-strategies-with-r (see also references in the post)? $\endgroup$
    – vonjd
    Jun 3, 2021 at 16:06
  • $\begingroup$ Thanks for the reply. The blog you mentioned is quite comprehensive but it uses R, I am looking for something in python. $\endgroup$ Jun 3, 2021 at 18:29
  • $\begingroup$ Did you find any resources? I have exactly the same needs. $\endgroup$ Jul 17, 2022 at 14:27
  • $\begingroup$ No. I just got busy with some other work. If you find anything regarding this please do share here. Also if you would like to collaborate on this project from scratch we can do that also. $\endgroup$ Jul 18, 2022 at 15:27
  • $\begingroup$ I don't know of a resource because Bloomberg does it quite quickly and efficiently but if you have something that works for a single leg (option), it will also work for multiple legs because the total PNL is simply the sum of the individual legs (also applies to Greeks). $\endgroup$
    – AKdemy
    Jul 19, 2022 at 9:09


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.