A Python library for evaluating option trading strategies.
Project description
optionlab
This package is a lightweight library written entirely in Python, designed to provide quick evaluation of option strategies.
The code produces various outputs, including the profit/loss profile of the strategy on a user-defined target date, the range of stock prices for which the strategy is profitable (i.e., generating a return greater than $0.01), the Greeks associated with each leg of the strategy, the resulting debit or credit on the trading account, the maximum and minimum returns within a specified lower and higher price range of the underlying asset, and an estimate of the strategy's probability of profit.
The probability of profit (PoP) for the strategy is calculated based on the distribution of estimated prices of the underlying asset on the user-defined target date. Specifically, for the price range in the payoff where the strategy generates profit, the PoP represents the probability that the stock price will fall within that range. This distribution of underlying asset prices on the target date can be lognormal, log-Laplace, or derived from the Black-Scholes model. Additionally, the distribution can be obtained through simulations (e.g., Monte Carlo) or machine learning models.
Despite the code having been developed with option strategies in mind, it can also be used for strategies that combine options with stocks and/or take into account the profits or losses of closed trades.
If you have any questions, corrections, comments or suggestions, just drop a message. You can also reach me on Linkedin.
Contributions
Although functional, optionlab is still in its early stages of development. The author has limited time available to work on this library, which is why contributions from individuals with expertise in options and Python programming are greatly appreciated.
Disclaimer
This is free software and is provided as is. The author makes no guarantee that its results are accurate and is not responsible for any losses caused by the use of the code. Bugs can be reported as issues on GitHub.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file optionlab-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: optionlab-0.1.7-py3-none-any.whl
- Upload date:
- Size: 38.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e5abec31a2583815cad55642578c9e81473804cf09a7182603c03f15c6589ec |
|
MD5 | cba7b878ba5f12b7ba8b0af2d9f0249e |
|
BLAKE2b-256 | 3c7dfa9f50f4b46f47d00035bfbf963355451db5d028757d15fb2d53a35b5a3d |