Email: saimanishprabhakar2020@gmail.com
A simple web-app that allows users to calculate and visualize the payoff profiles for a wide range of options trading strategies.
The supported strategies include: Long Call, Short Call, Long Put, Short Put, Bull Call Spread, Bear Put Spread, Long Straddle, Long Strangle, Strip, Strap, and Long Butterfly.
The dashboard provides a user-friendly interface for inputting the necessary options parameters for each selected strategy, and generates detailed payoff tables and charts to help users better understand the risk and reward characteristics of each strategy.
git clone https://github.com/your_username/options-strat-payoff.git
cd options-strat-payoff
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Mac/Linux:
source venv/bin/activate
# On Windows:
venv\Scripts\activate
# Install required libraries
pip install -r requirements.txt
# When done working on the project
deactivate
# If you prefer not to use a virtual environment, you can directly install dependencies
pip install -r requirements.txt
git remote set-url origin github_username/options-strat-payoff
git remote -v # confirm the changes
Select a strategy from the dropdown list and input relevant parameters pertaining to chosen strategy
If you are unsure what the parameter represents, please hover over the question mark symbol beside the specific parameter for additional context.
The project contains validators ensuring all parameters inputted by the user are accurate, if you do input values that do not make logical sense, you will be prompted with a message such as the one below seen in the image.
In this image, the start price (i.e. start expiration price) is greater than the strike price which results in an error as the correct format should be (start exp price < strike price < end exp price).
After all of the parameters have been inputted by the user, you will be presented with a payoff table that displays the expiration price range (start price to end price, incremented by step size), the premium, the value of the option (call/put), and lastly the net-payoff of the strategy.
The rows of the table are colour coded to represent the moneyness of the strategy depending on the parameters inputted by the user.
- Green: Strategy is ITM (Where Net-Payoff > 0)
- Light Blue: Break-Even Point of Strategy (Where Net-Payoff = 0)
- Red: Strategy is OTM (Where Net-Payoff < 0)
The payoff graph simply visualises the payoff table, highlighting the profit/loss zones using the same green/red colours representing the moneyness of the options / strategy itself. Break-Even Points are highlighted using the text 'BEP' and an arrow pointing to a green marker.
For complex strategies that employ multiple options, multiple BEP markers will be displayed accordingly.
And... that is all.
For those more inclined to learn more about the mathematical expressions behind each options strategy's payoff, you can read the final section of this file which breaks down each formula with labels.
I genuinely hope you find some value from this project, and hope it serves you in your journey towards mastering options and other derivatives.
If you would like to contribute to the development of the options strategy payoff calculator (always looking to add more strategies to the project), please:
- Feel free to clone the repository to your local machine (follow the steps in the 'Getting Started' section)
- Make your contribution, and then submit a pull request.
- Use the discussions tab within the repository and raise issues if needed.
The payoff calculations for each strategy are based on the following mathematical expressions:
where
where
where
where
where
where
where
where
where