Member-only story
Visualizing Option Trading Strategies in Python
A walk-through of how to plot option payoff diagrams using opstrat package in python
Introduction
An option is a derivative, a contract that gives the buyer the right, but not the obligation, to buy or sell the underlying asset by a certain date (expiration date) at a specified price (strike price).
There are two types of options: calls and puts. Traders can construct option strategies ranging from buying or selling a single option to very complex ones that involve multiple simultaneous option positions.
Option payoff diagrams are profit and loss charts that show the risk/reward profile of an option or combination of options. As option probability can be complex to understand, payoff diagrams gives an insight into the risk/reward for the trading strategy.
Opstrat Package
Opstrat is a python package which can be used for visualizing options, without the need of complex coding. The package provides functions for constructing payoff diagrams for single options as well as complex strategies involving multiple positions.
The package is also compatible with yahoo finance package and can be used to generate option payoff diagrams fetching data from yahoo finance API.
Installing the package