Skip to content
forked from aaguiar10/gflows

View the exposures of four option greeks—delta, gamma, vanna, and charm—for three major stock indexes

License

Notifications You must be signed in to change notification settings

rdyvptnm/gflows

 
 

Repository files navigation

G|Flows

G|Flows, or Greek Flows, provides 30-minute updates for the SPX, NDX, and RUT indexes every Monday-Friday from 9:00am-4:30pm ET.

Features

Measure by date & strike price:

  • Delta, gamma, vanna, and charm exposure for stocks/indexes
  • Implied volatility (IV) average

Expirations to choose:

  • All expirations
  • Current month
  • Current monthly OPEX
  • 0DTE, if available, otherwise the closest expiration

Guide:

  • Need a refresh? View the meaning behind each greek and how their flows can be interpreted

Setup

Compatible with Python versions >=3.9

Install the app's required packages:

$ pip install -r requirements.txt

(Recommended) To keep the package installation local/within a virtual environment, run these before the pip command:

$ python -m venv venv
$ source venv/bin/activate

Configuration:

Create a .env file in the project's working directory to configure the app, otherwise the app will use default values:

API_URL=YOURAPIURL      # For downloading options data. If not set, the app defaults to a CBOE API — see ticker_dwn for info
AUTO_RESPONSE=y         # Auto-respond to prompt 'Download recent data? (y/n).' If not set, user input is requested
TICKERS=^SPX,^NDX,^RUT  # Default. Choose tickers from https://finance.yahoo.com/lookup (excluding futures)

my_app.py:

G|Flows uses a scheduler to periodically redownload options data. To disable it, comment out this code

"""
# schedule when to redownload data
sched = BackgroundScheduler(daemon=True)
sched.add_job(
    sensor,
    CronTrigger.from_crontab(
        "0,30 9-16 * * 0-4", timezone=timezone("America/New_York")
    ),
)
sched.start()
"""

To analyze CSV data, change the is_json value to False within the analyze_data function

def analyze_data(ticker, expir):
    # Analyze stored data of specified ticker and expiry
    # defaults: json format, timezone 'America/New_York'
    result = get_options_data(
        ticker,
        expir,
        is_json=True, # False for CSV
        tz="America/New_York",
    )
    ...

For manual updates, CSV-formatted options data can be downloaded here then placed in the data/csv directory


Upon completion, run the Dash app (available at http://localhost:8050):

$ python my_app.py

About

View the exposures of four option greeks—delta, gamma, vanna, and charm—for three major stock indexes

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.6%
  • CSS 3.4%