Real-time cryptocurrency trading analysis platform with pattern recognition and trading signals.
- Multi-Exchange Price Aggregation - Aggregated prices from Binance, Coinbase, and Kraken
- Real-time Market Data - Live price feeds via WebSocket connections
- Optional Redis Caching - Fast lazy loading with configurable caching layer
- Pattern Recognition - Automatic candlestick pattern detection
- Doji, Hammer, Shooting Star
- Engulfing patterns (Bullish/Bearish)
- Morning Star, Evening Star
- Marubozu and more
- Trading Signals - Entry, stop-loss, and target levels
- Multiple Timeframes - 1m, 5m, 15m, 1h, 4h
- Top 10 Crypto Pairs - BTC, ETH, BNB, XRP, ADA, SOL, DOGE, DOT, MATIC, LTC
The dashboard displays:
- Real-time price tickers with 24h change
- Interactive candlestick charts
- Pattern detection alerts
- Trading decision panel with entry/exit levels
- Node.js 14+ (v18+ recommended for full features)
- npm (comes with Node.js)
- Redis (optional, for caching) - Install from https://redis.io or use Docker
git clone <repository-url>
cd trading-frameworknpm installnpm startNavigate to: http://localhost:3001
trading-framework/
├── server.js # Backend server (Express + WebSocket)
├── package.json # Dependencies and scripts
├── .gitignore # Git ignore rules
├── README.md # This file
└── client/
└── dist/
└── index.html # Frontend dashboard
| Endpoint | Description |
|---|---|
GET /health |
Server health check |
GET /api/instruments |
List of supported trading pairs |
GET /api/tickers |
Current prices for all pairs |
GET /api/candles/:instrument/:timeframe |
Historical candle data |
Connect to ws://localhost:3001 for real-time updates:
const ws = new WebSocket('ws://localhost:3001');
ws.onmessage = (event) => {
const { type, data } = JSON.parse(event.data);
// type: 'init', 'ticker', 'candle_update'
};| Symbol | Name |
|---|---|
| BTC_USDT | Bitcoin |
| ETH_USDT | Ethereum |
| BNB_USDT | Binance Coin |
| XRP_USDT | Ripple |
| ADA_USDT | Cardano |
| SOL_USDT | Solana |
| DOGE_USDT | Dogecoin |
| DOT_USDT | Polkadot |
| MATIC_USDT | Polygon |
| LTC_USDT | Litecoin |
The system detects the following candlestick patterns:
- Hammer / Hanging Man - Potential trend reversal
- Shooting Star / Inverted Hammer - Bearish/Bullish reversal signals
- Engulfing Patterns - Strong reversal indicators
- Morning Star / Evening Star - 3-candle reversal patterns
- Marubozu - Strong momentum candles
- Doji - Market indecision
- Volume Analysis - High volume confirmation of moves
Create a .env file in the root directory (use .env.example as a template):
# Server Configuration
PORT=3001
# Redis Caching (optional)
USE_REDIS=false # Set to 'true' to enable Redis caching for faster lazy loadingEdit server.js to customize:
const CONFIG = {
INSTRUMENTS: ['BTCUSDT', 'ETHUSDT', ...], // Trading pairs
TIMEFRAMES: ['1m', '5m', '15m', '1h', '4h'], // Timeframes
RECONNECT_DELAY: 5000, // WebSocket reconnect delay
};Redis caching is disabled by default. To enable it:
-
Install and start Redis:
# Using Docker docker run -d -p 6379:6379 redis:latest # Or install locally # macOS: brew install redis && brew services start redis # Ubuntu: sudo apt install redis-server && sudo systemctl start redis
-
Enable Redis in your environment:
# Set in .env file USE_REDIS=true # Or set as environment variable export USE_REDIS=true npm start
Benefits of Redis caching:
- Instant data loading from cache (< 100ms vs 2-3 seconds)
- Reduces API calls to exchanges
- Background refresh for fresh data
Running without Redis:
- Server works normally without Redis installed
- Data is fetched directly from exchange APIs on startup
- No caching layer, but still fully functional
npx kill-port 3001
npm start- Check your internet connection
- Binance API may be blocked in some regions
- Try using a VPN if needed
If you see Unexpected token '??=' error:
- Upgrade Node.js to v18+ from https://nodejs.org
- Backend: Node.js, Express, WebSocket (ws)
- Frontend: Vanilla JS, Lightweight Charts
- Data Source: Binance Public API
This tool is for educational and informational purposes only. It is NOT financial advice. Trading cryptocurrencies involves substantial risk of loss. Always do your own research and never trade with money you cannot afford to lose.
MIT License - feel free to use and modify for your own projects.
Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.