A Fibonacci Trading Analysis Platform implementing the SignalPro strategy for algorithmic trading analysis.
Backend: Complete - Fibonacci calculators, signal detection, and harmonic patterns. Frontend: Active development - Chart with Yahoo Finance integration, Fibonacci overlays, pivot detection.
| Component | Technology | Status |
|---|---|---|
| Backend | Python 3.13, FastAPI | Complete |
| Testing | pytest, pytest-cov, ruff, mypy | Active |
| Frontend | Next.js 16, TypeScript, Tailwind CSS | Active |
| Charting | TradingView Lightweight Charts | Active |
| UI Components | shadcn/ui | Active |
| Market Data | Yahoo Finance (yahoo-finance2) | Active |
| Database | PostgreSQL | Active |
- Retracement: Key pullback levels (38.2%, 50%, 61.8%, 78.6%)
- Extension: Levels beyond the range (127.2%, 161.8%, 261.8%)
- Projection: Three-point AB=CD pattern projection
- Expansion: Range expansion levels from a starting move
Detect trading signals at Fibonacci levels:
- Type 1: Level tested and rejected (stronger signal)
- Type 2: Close beyond level without deep test
- Strength scoring (0.0 - 1.0) based on signal type and price distance
Detect classic harmonic patterns using XABCD points:
| Pattern | AB Ratio | D Level |
|---|---|---|
| Gartley | 61.8% | 78.6% retracement |
| Butterfly | 78.6% | 127.2-161.8% extension |
| Bat | 38.2-50% | 88.6% retracement |
| Crab | 38.2-61.8% | 161.8% extension |
The backend provides 45+ REST endpoints organized by domain:
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| POST | /analyze |
Unified analysis - market data, pivots, Fibonacci, signals |
| Method | Endpoint | Description |
|---|---|---|
| POST | /fibonacci/retracement |
Calculate retracement levels (38.2%, 50%, 61.8%, 78.6%) |
| POST | /fibonacci/extension |
Calculate extension levels (127.2%, 161.8%, 261.8%) |
| POST | /fibonacci/projection |
Calculate 3-point ABC projection levels |
| POST | /fibonacci/expansion |
Calculate expansion levels from pivot |
| Method | Endpoint | Description |
|---|---|---|
| POST | /signal/detect |
Detect Type 1/2 signals at Fibonacci level |
| POST | /harmonic/validate |
Validate XABCD harmonic pattern |
| POST | /harmonic/reversal-zone |
Calculate D point for pattern completion |
| POST | /pivot/detect |
Detect swing highs/lows with lookback |
| POST | /pivot/swings |
Classify swings (HH/HL/LH/LL) |
| Method | Endpoint | Description |
|---|---|---|
| POST | /indicators/macd |
Calculate MACD (configurable periods) |
| POST | /indicators/rsi |
Calculate RSI (default period 14) |
| Method | Endpoint | Description |
|---|---|---|
| GET | /workflow/assess |
Assess trend from swing patterns |
| GET | /workflow/align |
Check multi-timeframe alignment |
| GET | /workflow/levels |
Identify Fibonacci levels with confluence |
| GET | /workflow/confirm |
Confirm with RSI/MACD indicators |
| GET | /workflow/categorize |
Categorize trade (with_trend/counter/reversal) |
| GET | /workflow/opportunities |
Scan symbols for trade opportunities |
| Method | Endpoint | Description |
|---|---|---|
| POST | /position/size |
Calculate position size from risk |
| POST | /position/risk-reward |
Calculate R:R ratio with targets |
| Method | Endpoint | Description |
|---|---|---|
| GET | /market-data |
Fetch OHLC with caching and fallback |
| GET | /market-data/providers |
Get provider status and rate limits |
| Method | Endpoint | Description |
|---|---|---|
| POST | /journal/entry |
Create journal entry |
| GET | /journal/entry/{id} |
Get single entry |
| GET | /journal/entries |
List entries (optional symbol filter) |
| PUT | /journal/entry/{id} |
Update entry |
| DELETE | /journal/entry/{id} |
Delete entry |
| GET | /journal/analytics |
Get aggregated analytics |
| DELETE | /journal/entries |
Clear all entries |
trader/
├── backend/ # Python/FastAPI backend
│ ├── src/trader/ # Source modules
│ └── tests/ # Unit and integration tests
├── frontend/ # Next.js frontend
│ ├── src/app/ # App router pages and API routes
│ ├── src/components/ # React components (trading, ui)
│ └── src/hooks/ # Custom React hooks
├── pinescript/ # TradingView Pine Script indicators
│ └── indicators/ # Custom indicators matching backend
├── docs/ # All documentation
│ ├── backend/ # Backend technical docs
│ ├── frontend/ # Frontend technical docs
│ ├── adr/ # Architecture Decision Records
│ └── references/ # Strategy specifications
docker compose up --buildThis starts PostgreSQL, backend, and frontend. Access the app at http://localhost:3000
See Development Setup Guide for full documentation.
# Terminal 1: Database
docker compose -f docker-compose.dev.yml up
# Terminal 2: Backend
cd backend
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Unix
pip install -e ".[dev]"
alembic upgrade head
uvicorn trader.main:app --reload
# Terminal 3: Frontend
cd frontend
npm install
npm run devVisit http://localhost:3000/chart for the interactive chart.
- RED: Write failing test first
- GREEN: Write minimal code to pass
- REFACTOR: Quality checks (ruff, mypy, 100% coverage)
- COMMIT: Conventional commits format
type(scope): description
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Types: feat, fix, docs, test, refactor, build, chore
| Higher TF | Lower TF | Action |
|---|---|---|
| UP | DOWN | GO LONG (buy the dip) |
| DOWN | UP | GO SHORT (sell the rally) |
| Same | Same | STAND ASIDE |
- BUY: Close > Open AND Close > Fibonacci Level
- SELL: Close < Open AND Close < Fibonacci Level
Position Size = Risk Capital / (Entry Price - Stop Loss Price)
- ✅ Core Fibonacci calculations with API
- ✅ Signal bar detection with Type 1/2
- ✅ Harmonic pattern detection (Gartley, Butterfly, Bat, Crab)
- ✅ Harmonic pattern API endpoints
- ✅ Frontend with TradingView Lightweight Charts
- ✅ Yahoo Finance market data integration
- ✅ Auto-refresh with market status display
- ✅ Connect frontend to backend API for Fibonacci/signals
- ✅ Position sizing calculator with risk management
- ✅ Configurable pivot point detection
- ✅ Multi-timeframe trend alignment analysis
- ✅ Real-time pattern scanner (Signal + Harmonic)
- ✅ 8-step trading workflow with state management
- ✅ Multi-timeframe viewer with trends and OHLC
- ✅ Centralized market data provider with caching
- 🔄 Trade journaling and analytics (backend complete)
- ⬜ Broker integration
All documentation is centralized in the docs/ folder:
| Folder | Description |
|---|---|
| docs/backend/ | Backend technical documentation |
| docs/frontend/ | Frontend technical documentation |
| docs/adr/ | Architecture Decision Records |
| docs/references/ | Strategy knowledge and specifications |
| pinescript/ | TradingView Pine Script indicators |
API Docs: Run server and visit /docs for interactive OpenAPI documentation.
See the TDD workflow above. Maintain 100% test coverage and pass all linting checks before committing.