Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📊 MarketInsighter

A self-hosted market scanner and insight dashboard for crypto & US stocks — technical signals, news sentiment, and AI-powered setup analysis. Free data, free AI, no accounts required.

Features · Quick start · AI setup · Configuration · Architecture · API


MarketInsighter scanner

More screenshots

Detail panel with chart, signals, AI analysis and news

✨ Features

  • Crypto scanner — scans every USDT pair on Binance (~600 pairs, 1-hour candles) using Binance's free public data mirror. No API key, no account.
  • Stock scanner — 34 liquid US megacaps and index ETFs (AAPL, NVDA, SPY, QQQ, …) via Yahoo Finance's public endpoints. No key needed. Easily extendable.
  • Technical signals — computed server-side on real candle data:
    • RSI(14) overbought / oversold
    • MACD bullish / bearish crosses
    • Volume spikes vs the 20-period average
    • Bollinger Band squeezes and band breaks
    • MA50 crosses
  • Composite scoring — every symbol gets a score so the most interesting setups float to the top.
  • Live dashboard — sortable table with sparklines and signal badges, search, signal filters (Bullish / Bearish / Vol spikes / Squeezes), market summary tiles, auto-refresh every 60s, light & dark themes.
  • Real charts — full TradingView embedded chart (candles + RSI) for any symbol TradingView lists; pairs it doesn't carry automatically fall back to a chart rendered from Binance candle data, so every row always has a chart.
  • News + sentiment — recent headlines per symbol with lexicon-based positive/negative scoring.
  • AI setup analysis — a plain-English read of any symbol's setup (trend, momentum, signals, news context, bull & bear case). Works with any OpenAI-compatible endpoint, Ollama (fully local & free), Groq, Gemini, or Claude.
  • Free-tier protection — hard server-side caps on AI calls plus per-symbol caching, so a free API key can never run away.

🚀 Quick start

Prerequisites: Node.js 18+ (20 recommended) and npm.

git clone https://github.com/YOUR_USERNAME/MarketInsighter.git
cd MarketInsighter
npm install
npm run dev

Open http://localhost:5173 — the scanner works immediately, no configuration needed. (The API server runs on port 8787.)

The only optional step is enabling AI analysis:

cp .env.example .env
# edit .env and configure ONE provider (see below), then restart npm run dev

🤖 AI analysis setup

The "Analyze this setup" button turns technical data + headlines into a short plain-English read. The server picks the first configured provider in this order:

Option 1 — Any OpenAI-compatible endpoint (recommended)

Works with Ollama, LM Studio, LocalAI, vLLM, llama.cpp server, OpenRouter, Groq, and anything else that speaks the OpenAI chat-completions protocol:

# .env — pick one backend:

# Groq (free key at https://console.groq.com)
AI_BASE_URL=https://api.groq.com/openai
AI_API_KEY=gsk_...
AI_MODEL=llama-3.3-70b-versatile

# OpenRouter free models (free key at https://openrouter.ai)
AI_BASE_URL=https://openrouter.ai/api
AI_API_KEY=sk-or-...
AI_MODEL=meta-llama/llama-3.3-70b-instruct:free

# LM Studio running locally — no key at all
AI_BASE_URL=http://localhost:1234
AI_MODEL=your-loaded-model

Option 2 — Ollama (fully local, free, zero config)

# install from https://ollama.com then:
ollama pull llama3.2

That's it — the server auto-detects Ollama on localhost:11434. No key, no .env, works offline.

Option 3 — Direct provider keys

ANTHROPIC_API_KEY=sk-ant-...   # Claude (paid)
GROQ_API_KEY=gsk_...           # Groq free tier
GEMINI_API_KEY=...             # Google Gemini free tier

Free-tier protection

AI calls are hard-capped server-side: 10/minute and 250/day by default (tune with AI_LIMIT_PER_MIN / AI_LIMIT_PER_DAY — raise them freely for local backends, where calls cost nothing). Each symbol's analysis is cached for 10 minutes; cached hits are instant and don't count against the caps.

⚙️ Configuration

All configuration lives in .env (copy .env.example). Everything is optional.

Variable Default Purpose
AI_BASE_URL / AI_MODEL / AI_API_KEY Any OpenAI-compatible AI endpoint (highest priority)
ANTHROPIC_API_KEY Claude analysis
GROQ_API_KEY / GROQ_MODEL llama-3.3-70b-versatile Groq analysis
GEMINI_API_KEY / GEMINI_MODEL gemini-flash-latest Gemini analysis
OLLAMA_URL / OLLAMA_MODEL http://localhost:11434 / first installed model Local Ollama
AI_LIMIT_PER_MIN / AI_LIMIT_PER_DAY 10 / 250 AI call caps
PORT 8787 API server port

Changing the stock universe: edit DEFAULT_STOCKS in server/src/sources/stocks.ts.

🏗️ Architecture

Two npm workspaces, zero databases, zero external accounts:

server/                     Express + TypeScript API (port 8787)
  src/sources/crypto.ts     Binance public REST (data-api.binance.vision mirror)
  src/sources/stocks.ts     Yahoo Finance v8 chart + v1 search endpoints
  src/indicators.ts         SMA, EMA, RSI (Wilder), MACD, Bollinger Bands
  src/scan.ts               signal detection + composite scoring
  src/news.ts               headline sentiment (lexicon-based)
  src/analyze.ts            multi-provider AI analysis
  src/tvcheck.ts            TradingView symbol availability check
  src/index.ts              routes, caching, AI rate limiting

web/                        Vite + React dashboard (port 5173)
  src/App.tsx               scanner table, filters, stat tiles, detail panel
  src/charts.tsx            sparklines, Binance fallback chart, TradingView embed
  src/Logo.tsx              the MarketInsighter mark

Scan results are cached in memory (2 min) to stay friendly to the data providers. The frontend proxies /api/* to the backend in dev; for production, npm run build produces web/dist (static) and server/dist (Node).

📡 API reference

The backend is a small JSON API you can use directly:

Endpoint Description
GET /api/scan/crypto · GET /api/scan/stocks Full scan: price, change, RSI, MACD, volume ratio, signals, score, sparkline per symbol
GET /api/candles/:market/:symbol Raw OHLCV candles
GET /api/news/:market/:symbol Recent headlines with sentiment scores
GET /api/tvcheck/:market/:symbol Whether the symbol exists on TradingView
POST /api/analyze {"market":"crypto","symbol":"BTCUSDT"} AI setup analysis (429 when rate-capped)
GET /api/health Server status + active AI provider

🧑‍💻 Contributing

Issues and PRs welcome. To hack on it:

npm run dev      # both servers with hot reload
npm run build    # typecheck + production build of both workspaces

Ideas that would make good first contributions: more signal types (support/resistance, gap scans), configurable watchlists in the UI, alerting (Telegram / desktop notifications), WebSocket streaming prices, more markets.

⚠️ Disclaimer

MarketInsighter is an educational screening tool. Nothing it displays — signals, scores, sentiment, or AI-generated text — is financial advice or a recommendation to buy or sell any asset. Market data comes from third-party public endpoints and may be delayed, incomplete, or wrong. Do your own research; you are solely responsible for your trading decisions.

📄 License

MIT — free to use, modify, and distribute.

About

A self-hosted market scanner and insight dashboard for crypto & US stocks — technical signals, news sentiment, and AI-powered setup analysis. Free data, free AI, no accounts required.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages