Utilities for analysing equity call options and covered call positions.
Install dependencies with:
pip install -r requirements.txtapp/
├── zen_garden.py # FastAPI entrypoint with scheduler
├── api/
│ └── routes.py # REST endpoints to trigger jobs
├── auth/
│ └── users.py # fastapi-users configuration
├── scheduler/
│ └── jobs.py # APScheduler jobs
├── services/
│ ├── portfolio_fixer.py
│ └── stock_live_comparison.py
└── utils/
├── excel_exporter.py
└── mongo_client.py
Run the API and scheduler with:
python app/zen_garden.pyBuild and launch the API together with MongoDB using Docker:
./docker-run-stock-app.shThe service will be available at http://localhost:8000.
analyze_options(ticker_symbol, min_volume=50, max_expirations=2, min_annual_tv_pct=9.9, max_otm_pct=5.0) -> pandas.DataFrame
from option_analyzer_v5 import analyze_options
df = analyze_options("ORCL")
print(df.head())analyze_options(tickers, min_time_value=0.10) -> pandas.DataFrame
from option_time_value import analyze_options
df = analyze_options(["ORCL", "MSFT"], min_time_value=0.25)optimize_options(ticker_symbol, min_volume=50, max_expirations=2, min_annual_tv_pct=9.9, max_otm_pct=5.0, min_days=5, max_results=20) -> pandas.DataFrame
from option_optimizer import optimize_options
df = optimize_options("ORCL")analyze_covered_calls(file_path) -> pandas.DataFrame
from covered_call_analysis import analyze_covered_calls
df = analyze_covered_calls("ibkr_positions.csv")Each module also includes a small main() function so it can be executed
directly, e.g. python option_optimizer.py.
Run the unit tests with:
pytest -q