A lot of people have been asking how I've been testing option-based algorithms on Quantopian, so I've decided to share this with you all; it is a work around until Quantopian adds option capabilities to their pipeline.
I didn't comment this, but I don't think it is too hard to follow...
I've created a virtual cash balance that is just an integer variable (defaulted to $1 million). I then use the Black Scholes model to find the price of the option (or a close estimate thereof). When an option is purchased the price determined by Black Scholes is deducted from the virtual cash balance. When the option is sold, the fmv of the option is added back to this virtual cash balance. When the option is about to expire, the program automatically makes the appropriate decision for the investor and adjusts the virtual cash balance as needed.
The fmv of the virtual portfolio is shown each trading morning in the log. Unfortunately, there is no way that I know of to automatically export this data to a csv or excel via Quantopian. This can, however be done relatively quickly via a copy, paste.
Please let me know if you have any questions.