4
$\begingroup$

I've been tasked to create and backtest an option strategy. The strategy, in vague terms, is to essentially write call options on securities in a universe, i.e., selling insurance.

I have an idea of what I want to do, but since I'm new to using Python in this vein (I typically use it for automating processes or doing quick on-the-fly data analysis), I'm wondering what is the best approach to doing so?

Given that I have all the data (e.g., underlying security data, implied volatilities, deposit rates, etc.), should I just write a script that loops through the data along time, writing options, priced with a Black-Scholes pricer? Or, should I develop it in an object-orientated fashion?

I'm curious of the pros/cons of both. Please let me know if this not relevant to this site; I thought here would be a better place to ask than Stack Overflow.

Thanks,

VN

$\endgroup$
1

1 Answer 1

0
$\begingroup$

The scope of "create and backtest an option strategy" is broad. Ok so you narrowed it to a strategy of "selling call options". In order to test it effectively I suggest you start with some very simple assumptions:

  • the expiry of all your options are the same
  • you have a pricer to price the options
  • you assume you write options at the money (or not) at some trigger and hold to expiry, (i.e. vol is above some level - basing your trading strategy that vol is mean reverting so sell when it is higher than average)

Yes, I would write it in an object-oriented way so that you can expand it, and the most important thing about it is the documentation. Not only will this help someone else follow but it will better help you plan the structure of what you are doing. There are so many potential avenues for you to go down and calibrations to be made that having a script will quickly become unmanageable, while a package to import will be much better.

$\endgroup$

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.