Giter Site home page Giter Site logo

drjohnelliott / gflows Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aaguiar10/gflows

0.0 0.0 0.0 3.5 MB

View the exposures of four option greeks—delta, gamma, vanna, and charm—for stocks & indexes

Home Page: https://gflows.app

License: MIT License

JavaScript 0.77% Python 93.50% CSS 5.70% Procfile 0.03%

gflows's Introduction

G|Flows

G|Flows, or Greek Flows, provides 15-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

This application is compatible with Python versions >=3.9

Virtual Environment (Recommended)

For an isolated package installation, create and activate a virtual environment:

# Create venv
$ python -m venv venv

Activation:

  • Linux/Mac:

    $ source venv/bin/activate
  • Windows:

    # Command Prompt
    $ venv\Scripts\activate.bat
    
    # PowerShell
    $ venv\Scripts\Activate.ps1

Install Required Packages

$ pip install -r requirements.txt

Configuration:

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

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

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,
    combining.OrTrigger(
        [
            cron.CronTrigger.from_crontab(
                "0,15,30,45 9-15 * * 0-4", timezone=timezone("America/New_York")
            ),
            cron.CronTrigger.from_crontab(
                "0,15,30 16 * * 0-4", timezone=timezone("America/New_York")
            ),
        ]
    ),
)
sched.add_job(
    check_for_retry,
    combining.OrTrigger(
        [
            cron.CronTrigger(
                day_of_week="0-4",
                hour="9-15",
                second="*/5",
                timezone=timezone("America/New_York"),
            ),
            cron.CronTrigger(
                day_of_week="0-4",
                hour="16",
                minute="0-30",
                second="*/5",
                timezone=timezone("America/New_York"),
            ),
        ]  # during the specified times, check every 5 seconds for a retry condition
    ),
)
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 app.py

gflows's People

Contributors

aaguiar10 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.