Metadata-Version: 2.3
Name: pybacktestchain_options
Version: 0.1.1
Summary: A backtesting package for options
License: MIT
Author: Guillaume Touly
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Dist: numba (>=0.60.0,<0.61.0)
Requires-Dist: pandas (>=2.2.3,<3.0.0)
Requires-Dist: pybacktestchain (>=0.2.1,<0.3.0)
Requires-Dist: typer[all] (>=0.15.1,<0.16.0)
Requires-Dist: yfinance (>=0.2.51,<0.3.0)
Description-Content-Type: text/markdown

# pybacktestchain_options

A backtesting package for equity and commodity.

On the equity side you can test all the strategies defined in pybacktestchain

On the commo side you can try the mean reversion play of the long term price on different commodities (OIL, GAS, WHEAT, CORN).

## Installation

```bash
$ pip install pybacktestchain_options
```

## Usage

You can either use the following code : 

```python

from datetime import datetime
import pandas as pd
from pybacktestchain.data_module import get_stocks_data 
from universal_backtest import UniversalBackTest

if __name__ == "__main__":
    # Parameters
    commo_equity = "COMMO"
    backtest = UniversalBackTest(initial_date=datetime(2023, 4, 1),
                                  final_date=datetime(2023, 12, 5),
                                    commo_equity=commo_equity)

    backtest.run_backtest()

```

Or you can replace commo_equity with "EQUITY" and adjist the parameters as it is done in pybacktestchain.



The other way to use it is through an API call : 

- run the file api.py
- open a new terminal and copy the following command lines : 

```bash 

curl -X POST http://127.0.0.1:5000/run_backtest \
-H "Content-Type: application/json" \
-d '{"commo_equity": "COMMO", "initial_date": "2023-01-01", "final_date": "2023-12-31", "cash": 1000000, "verbose": true}'
```


## Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

## License

`pybacktestchain_options` was created by Guillaume Touly. It is licensed under the terms of the MIT license.

## Credits

`pybacktestchain_options` was created with [`cookiecutter`](https://cookiecutter.readthedocs.io/en/latest/) and the `py-pkgs-cookiecutter` [template](https://github.com/py-pkgs/py-pkgs-cookiecutter).

