Discrete Delta Hedging for Our Options Simulator
The full reference lectures with recordings and code files are here: https://hangukquant.thinkific.com/courses/qt202-quantitative-options-testing
Code is also downloadable in this post.
The price has increased from 140 to 205 at time of writing. We will do a final price increase and END THE EARLY BIRD IN TWO DAYS, and list it at 245.
In the previous lectures:
we employed abstraction to write out a fairly acceptable backtest engine for testing out the variance premium.
We then improved it:
We implemented a rebalancing feature, and an option leg selector, so that we can test for arbitrary option structures such as calendar spreads and iron condors. We also introduced vectorization.
However, since we are not rebalancing our contracts continuously, our positions held are going to pick up delta exposure. It is common practise for option traders to employ discrete delta hedging.
This discrete hedging scheme acts in a similar manner to positional inertia, in that it is sectioned out to reduce txn costs. The difference is that positional inertia is employed to achieve some desired market exposure, while delta hedging is to rid of some gained exposure due to change in underlying variables to which option prices are sensitive to.
See how we tackle this problems in our improved code base. We use the mibian library to compute delta values using the Black Scholes Merton framework and employ discrete hedging with deterministic triggers.
This is actually our last code series for the options backtester for our Substack. In the lecture videos, we add some more details to our option simulator and integrate an advanced, no code formulaic parser in the ensuing QT series - released soon.
Code Files: