Implied Volatility & Option Greeks
This post describes a feature that is only available in the v1 engine. The v2 engine does not support options and likely never will. However, we will continue support of the v1 engine for the foreseeable future.
TuringTrader is one of the very few backtesting engines supporting option strategies. Now, we have made it even more useful, by adding the capability to calculate implied volatility, as well as option greeks. Specifically, the following parameters can be calculated:
- Implied Volatility,
- Delta
- Gamma
- Vega
- Rho
- Theta
Our calculations are based on Espen Gaarder Haug’s fabulous book on option pricing formulas. This book is a collection of pretty much everything you would ever want to know about option formulas, and also contains a companion CD with VBA code and Excel spreadsheets.
Calculating option greeks with the new methods is straightforward. Here is a little snippet, detailing how to find an option with a specific delta:
To find our desired option, we use the BlackScholesImplied function, which first determines the implied volatility, and then calculates the option greeks accordingly. As you can see, the new functionality works well within Linq expression, helping to keep your code clean and concise.
If you are interested in the implementation of the option functions, have a peek at the repository: OptionSupport.cs
Happy coding!