# superOpStrat
This is a modification of the great [opstrat](https://github.com/hashabcd/opstrat) library by [Hash Abcd](https://github.com/hashabcd) to add the following features:
1. Ability to plot option values using Black-Scholes model by specifying days to expiration (dte) and volatility for each option leg.
   This is useful for plotting option strategies with options of different expiries like Calendar Spreads.
2. Ability to set y-axis limits using a custom function that takes the combined payoff array and returns a tuple (y_min, y_max).
3. Fix for y-axis values being off by a factor of 100.
Python library for visualizing options.
## Requirements
pandas, numpy, matplotlib, seaborn, yfinance
## Installation
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install opstrat.
```bash
pip install superOpStrat
```
Import the library as:
```python
import superOpStrat as op
```
## Usage
See the original opstrat library for usage instructions.
The new parameters for `multi_plotter` are:
1. `risk_free_rate`: float, default: 4.00
    Risk free rate in percentage
2. `default_volatility`: float, default: 32.00
    Default volatility in percentage used for all option legs that don't specify their own volatility.
    Only used when 'dte' is provided for options.
3. `y_limiter`: callable, optional, default: None
    A function that takes the combined payoff array (y) and returns a tuple (y_min, y_max) for setting ylim.
    If provided, will be called to set the y-axis limits. If None, matplotlib auto-scales the y-axis.
    Example: lambda y: (-max(abs(y)), max(abs(y))) for symmetric limits
4. Each leg in `op_list` can have the following additional keys:
    - `dte`: int, optional
        Days to expiration. If provided for one option, must be provided for all.
        When provided, uses Black-Scholes model to plot daily option values instead of payoff diagrams.
    - `volatility`: float, optional
        Implied volatility in percentage for this specific option leg.
        If not provided, uses the default_volatility parameter.
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": "https://github.com/pursual/superOpStrat",
    "name": "superOpStrat",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, options, finance, opstrat, data visualization, stock market",
    "author": "Tony G",
    "author_email": "\"Tony G (based on work by Abhijith Chandradas)\" <pursual@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a6/9f/28f76853005d91553174ff2137b0124cef38963f3c581caf763210913434/superopstrat-0.1.2.tar.gz",
    "platform": null,
    "description": "# superOpStrat\nThis is a modification of the great [opstrat](https://github.com/hashabcd/opstrat) library by [Hash Abcd](https://github.com/hashabcd) to add the following features:\n1. Ability to plot option values using Black-Scholes model by specifying days to expiration (dte) and volatility for each option leg.\n   This is useful for plotting option strategies with options of different expiries like Calendar Spreads.\n2. Ability to set y-axis limits using a custom function that takes the combined payoff array and returns a tuple (y_min, y_max).\n3. Fix for y-axis values being off by a factor of 100.\n\nPython library for visualizing options.\n\n## Requirements\npandas, numpy, matplotlib, seaborn, yfinance\n\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install opstrat.\n\n```bash\npip install superOpStrat\n```\n\nImport the library as:\n```python\nimport superOpStrat as op\n```\n\n\n## Usage\n\nSee the original opstrat library for usage instructions.\n\nThe new parameters for `multi_plotter` are:\n\n1. `risk_free_rate`: float, default: 4.00\n    Risk free rate in percentage\n\n2. `default_volatility`: float, default: 32.00\n    Default volatility in percentage used for all option legs that don't specify their own volatility.\n    Only used when 'dte' is provided for options.\n\n3. `y_limiter`: callable, optional, default: None\n    A function that takes the combined payoff array (y) and returns a tuple (y_min, y_max) for setting ylim.\n    If provided, will be called to set the y-axis limits. If None, matplotlib auto-scales the y-axis.\n    Example: lambda y: (-max(abs(y)), max(abs(y))) for symmetric limits\n\n4. Each leg in `op_list` can have the following additional keys:\n    - `dte`: int, optional\n        Days to expiration. If provided for one option, must be provided for all.\n        When provided, uses Black-Scholes model to plot daily option values instead of payoff diagrams.\n    - `volatility`: float, optional\n        Implied volatility in percentage for this specific option leg.\n        If not provided, uses the default_volatility parameter.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Enhanced options payoff diagram charting based on opstrat library",
    "version": "0.1.2",
    "project_urls": {
        "Homepage": "https://github.com/pursual/superOpStrat"
    },
    "split_keywords": [
        "python",
        " options",
        " finance",
        " opstrat",
        " data visualization",
        " stock market"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c1ebe23d2c4b11142f146cbaf06803aa1271819447365bc494f26aa5cbc1ebf4",
                "md5": "cb9ad0969007be582ae7c01514680b5b",
                "sha256": "3bd53b43cee250b512e0a41273949a7f3e9c84a90b233aa5d51ac64c47e30573"
            },
            "downloads": -1,
            "filename": "superopstrat-0.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cb9ad0969007be582ae7c01514680b5b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 10813,
            "upload_time": "2025-10-27T13:05:13",
            "upload_time_iso_8601": "2025-10-27T13:05:13.225219Z",
            "url": "https://files.pythonhosted.org/packages/c1/eb/e23d2c4b11142f146cbaf06803aa1271819447365bc494f26aa5cbc1ebf4/superopstrat-0.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a69f28f76853005d91553174ff2137b0124cef38963f3c581caf763210913434",
                "md5": "417d5a874019f455ac0428c868dbec79",
                "sha256": "e87a21e274ce5b96835742e195388df72c007eb198203e821b7a12e7b640798c"
            },
            "downloads": -1,
            "filename": "superopstrat-0.1.2.tar.gz",
            "has_sig": false,
            "md5_digest": "417d5a874019f455ac0428c868dbec79",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 8077,
            "upload_time": "2025-10-27T13:05:14",
            "upload_time_iso_8601": "2025-10-27T13:05:14.399957Z",
            "url": "https://files.pythonhosted.org/packages/a6/9f/28f76853005d91553174ff2137b0124cef38963f3c581caf763210913434/superopstrat-0.1.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-27 13:05:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pursual",
    "github_project": "superOpStrat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "matplotlib",
            "specs": [
                [
                    "==",
                    "3.10.6"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "2.2.6"
                ]
            ]
        },
        {
            "name": "pandas",
            "specs": [
                [
                    "==",
                    "2.3.2"
                ]
            ]
        },
        {
            "name": "seaborn",
            "specs": [
                [
                    "==",
                    "0.13.2"
                ]
            ]
        },
        {
            "name": "yfinance",
            "specs": [
                [
                    "==",
                    "0.2.65"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    "==",
                    "1.16.1"
                ]
            ]
        }
    ],
    "lcname": "superopstrat"
}