No description
  • JavaScript 63%
  • CSS 21.1%
  • EJS 15.9%
Find a file
2025-11-25 21:35:16 -08:00
public chart ema line 2025-11-25 21:35:16 -08:00
views favicons 2025-11-21 22:37:13 -08:00
.gitignore first commit 2025-11-18 21:28:07 -08:00
analyzer.log first commit 2025-11-18 21:28:07 -08:00
package-lock.json first commit 2025-11-18 21:28:07 -08:00
package.json first commit 2025-11-18 21:28:07 -08:00
README.md first commit 2025-11-18 21:28:07 -08:00
server.js changes 2025-11-21 19:13:42 -08:00
TRADING_PLAYBOOK.md playbook 2025-11-21 17:43:32 -08:00

Sigma-Visualizer

Web-based visualization dashboard for Sigma stock analysis data.

Smart Investment Guidance & Market Analysis

Features

  • Real-time Dashboard: Dark-themed, responsive interface
  • Stock Table: Sortable multi-column table with all analyzed stocks
  • Detailed Analysis: Interactive charts, entry points, and technical indicators
  • Live Console: Real-time application logs
  • PDF Export: Export individual stock analysis reports
  • Eastern Time Clock: Live market time display

Prerequisites

  • Node.js (v16 or higher)
  • stocks.db database file from sigma-analyzer

Installation

  1. Install dependencies:
npm install
  1. Ensure stocks.db exists in the parent directory (from sigma-analyzer)

  2. Start the server:

npm start
  1. Access the dashboard:
http://localhost:3000

Project Structure

sigma-visualizer/
├── server.js           # Express server and API endpoints
├── views/
│   └── index.ejs      # Main HTML template
├── public/
│   ├── css/
│   │   └── styles.css # Dark theme styling
│   └── js/
│       └── app.js     # Frontend JavaScript
└── package.json

API Endpoints

  • GET / - Main dashboard page
  • GET /api/stocks - Retrieve all stocks data
  • GET /api/stock/:ticker - Get detailed stock analysis
  • GET /api/time - Get current Eastern Time
  • POST /api/export-pdf/:ticker - Export stock analysis as PDF

Features in Detail

Container 1: Header

  • Application title and branding
  • Live Eastern Time clock

Container 2: Console

  • Real-time application logs
  • Collapsible view
  • Auto-scrolling log history

Container 3: Stock Table

  • Sortable columns (multi-sort support)
  • Click rows to view details
  • Displays: Ticker, Exchange, Price, 8-EMA, Support Levels

Container 4: Stock Details

Shows when a stock is selected:

Charts:

  • Price Action with Support/Resistance markers (90 days)
  • EMA Analysis (8-EMA and 20-EMA)

Metrics:

  • Current Price
  • Primary Entry Point
  • Secondary Entry Point

Stop Loss Levels:

  • Conservative (with risk %)
  • Moderate (with risk %)
  • Aggressive (with risk %)

Additional Data:

  • Analysis Insights (trend, EMAs, market cap)
  • Average Retracement Depth
  • Support Levels (top 5)
  • Fibonacci Retracements

Actions:

  • Export PDF
  • Close Details

Multi-Column Sorting

The stock table supports multiple sort columns:

  1. Click a column header to sort ascending
  2. Click again to sort descending
  3. Click a third time to remove sort
  4. Sort indicators show order and direction (e.g., ↑1, ↓2)

Docker Deployment

For deployment with sigma-analyzer in a Docker stack:

  1. Create a docker-compose.yml in the parent directory
  2. Configure both services to share the stocks.db file
  3. Use a shared volume for database access

Example docker-compose.yml structure:

version: '3.8'
services:
  sigma-analyzer:
    # analyzer configuration
  sigma-visualizer:
    # visualizer configuration
    volumes:
      - ./data:/app/data  # shared volume

Responsive Design

  • Desktop: Full multi-column layout
  • Tablet: Stacked chart layout
  • Mobile: Single-column, optimized for touch

Technology Stack

  • Backend: Node.js, Express
  • Database: SQLite (via sql.js)
  • Frontend: Vanilla JavaScript, Chart.js
  • Styling: Custom CSS with dark theme
  • Templating: EJS

Notes

  • Database reloads automatically on each API call to show latest data
  • Charts update dynamically when stock details are loaded
  • Console maintains last 100 log entries
  • Auto-refresh every 60 seconds

Development

For development with auto-reload, consider using nodemon:

npm install -g nodemon
nodemon server.js

Troubleshooting

Database not found:

  • Ensure stocks.db exists in ../stocks.db relative to sigma-visualizer
  • Run sigma-analyzer first to generate the database

Port already in use:

  • Change PORT in server.js (default: 3000)

Charts not displaying:

  • Check browser console for Chart.js errors
  • Ensure daily_data table has records for the selected stock