There've been lots of great threads on vol trading recently on fintwit from the likes of @VolQuant, @bennpeifert & many more! I thought I'd give it a go explaining how to backtest FX options + include Python code samples! 1/n
@VolQuant@bennpeifert Before you get into creating a trading signal, need to create a total returns time series for your option instrument of choice. Say you enter a long 1m EURUSD ATM straddle, need to mark it at entry 2/n
@VolQuant@bennpeifert As each day passes you need to remark the contract, which will involve interpolating the vol surface (given it'll no longer be a nice standard strike/tenor combination, like it was at entry!), & from that calculate options P&L 3/n
@VolQuant@bennpeifert There also a question of when you roll the option (at expiry, before end of the month etc.) 4/n
@VolQuant@bennpeifert You also need to think about your delta hedging scheme, and work out the spot P&L from that. None of this is "proprietary" (whatever signal you overlay on top, could however be your secret sauce!), but it a bit of a hassle to code up from experience. 5/n
@VolQuant@bennpeifert I haven't backtested equity options, but my guess is that there are some bits which are easier (standard strikes/tenors quoted), but other things which are difficult (have instruments which come in and out of an index etc.) 6/n
@VolQuant@bennpeifert The code assumes you have access to a BBG Terminal for data (& I've done all the ticker mappings!), but you should be able to adapt it for other sources. I haven't been able to find FX vol data from any free sources unfort. 8/n
@VolQuant@bennpeifert I'll try to write up a blog about this soon too. If anyone wants to contribute to finmarketpy to do the code for equity options backtest.. be my guest too :-) 9/n
• • •
Missing some Tweet in this thread? You can try to
force a refresh
Been writing Jupyter notebooks for a Python, alt data/NLP + large datasets course. As a result been using many libraries for large datasets.. here are a few takeaways on large datasets in Python 1/8
If you've got a small time series dataset, Pandas is often easiest choice, but what if it doesn't fit in memory? Can batch calculations, but what about libraries who do this for you! 2/8
Dask seems pretty easy to use, does all this "batching" for you and looks very much like Pandas, can work on a cluster too 3/8