Skip to content

(WIP) Node.js | Express.js, MongoDB, Chart.js | Visualizes real-time stock and options data with gamma levels and caching mechanisms.

License

Notifications You must be signed in to change notification settings

cl3880/options-edge

Repository files navigation

OptionsEdge: Visualizing Options-Based Support/Resistance

Overview

OptionsEdge is a Node.js and Express.js web app that identifies options-based support and resistance levels, such as put/call walls and gamma flips, using data from Alpha Vantage. It caches data in MongoDB to reduce API load and ensure fallback availability. A built-in watchlist lets users track and revisit tickers of interest.

Key Features

  • Real-Time Options Data: Fetch and display live options data including support/resistance levels and gamma flips.
  • Price Data Caching: Automatically caches intraday price series in MongoDB for API rate-limit resilience.
  • Charting: Interactive Chart.js charts with overlaid levels.
  • Watchlist Management: Add or remove tickers in your personal watchlist.

Project Structure

src/
├── app.js                # Main entry point and server setup
├── config.js             # Environment & API config
├── database.js           # MongoDB connection & TTL indexes
├── api/
│   └── alphaVantage.js   # Alpha Vantage HTTP client
├── controllers/
│   ├── tickerController.js    # Ticker search & detail handlers
│   └── watchlistController.js # Watchlist actions
├── services/
│   ├── userService.js     # Test user and watchlist helpers
│   ├── dataService.js     # Price fetch & cache logic
│   ├── optionsService.js  # Combine options + price into levels
│   ├── chartService.js    # Prepare data sets for Chart.js
│   └── optionsParser.js   # Parse raw option chain into strike format
├── db/
│   ├── historicalPrice.js # Mongoose model & cache ops
│   └── optionChain.js     # Mongoose model & cache ops
├── router/
│   ├── indexRouter.js     # Home & status routes
│   ├── tickerRouter.js    # /ticker routes
│   └── watchlistRouter.js # /watchlist routes
├── views/
│   ├── index.hbs          # Homepage
│   ├── ticker.hbs         # Search form
│   ├── ticker-detail.hbs  # Detail view with chart
│   └── watchlist.hbs      # Watchlist page
public/
├── javascripts/
│   ├── price-chart.js     # Renders Chart.js with fetched data
│   ├── ticker-search.js   # Handles ticker form + validation
│   └── warnings.js        # UI warnings and fallback prompts
└── stylesheets/
    └── styles.css         # App-wide CSS styling

Installation

  1. Clone your fork:
    git clone https://github.com/<your-username>/options-edge-nodejs.git
    cd options-edge-nodejs
  2. Install dependencies:
    npm install
  3. Configure environment variables in a .env file:
    ALPHA_VANTAGE_API_KEY=your_key_here
    MONGODB_URI=mongodb://localhost:27017/optionsflow
  4. Start the server:
    npm start

App runs at http://localhost:3000 by default.

API Endpoints

  • GET /: Home page and API status
  • GET /ticker: Search form for ticker lookup
  • GET /ticker/:symbol: Show options + chart for a symbol
  • GET /ticker/:symbol/json: JSON API for programmatic access
  • GET /watchlist: View watchlist page
  • POST /watchlist/add: Add a symbol to watchlist
  • POST /watchlist/remove: Remove a symbol from watchlist

To Do

  • Add user authentication and profiles
  • Enhance error handling for API rate limits
  • Write unit tests for service layers (e.g., options calculations)
  • Expand chart customization (timeframes, annotations)

License

This project is licensed under the terms of the GNU General Public License v3.0.
See the LICENSE file for details.

About

(WIP) Node.js | Express.js, MongoDB, Chart.js | Visualizes real-time stock and options data with gamma levels and caching mechanisms.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •