This project is a sophisticated cryptocurrency analysis and visualization tool developed by me in collaboration with PETE an institutional quantitative developer in , this is a proprietary trading framework designed for high-frequency and quantitative trading strategies, and this project leverages its capabilities to provide deep insights into cryptocurrency markets.
The tool connects to the Coinbase Cloud REST API to fetch historical price data for major cryptocurrencies such as Bitcoin (BTC), Ethereum (ETH), Solana (SOL), and Ripple (XRP). It processes this data using a suite of technical indicators, detects whale activity through volume anomaly analysis, and generates interactive visualizations to aid in trading decisions.
Originally starting as a basic data fetching script, the project has been iteratively enhanced with advanced features like the whale detector, multi-timeframe analysis, and comprehensive indicator calculations, making it a unique blend of institutional-grade quantitative analysis and user-friendly visualization.
The project performs the following key functions:
-
Data Acquisition: Fetches historical OHLCV (Open, High, Low, Close, Volume) data from Coinbase for multiple cryptocurrencies across various time granularities (1-minute, 15-minute, 60-minute, and daily).
-
Technical Indicator Calculation: Computes a wide array of technical indicators including:
- Simple Moving Averages (SMA3, SMA7)
- Exponential Moving Averages (EMA12, EMA26)
- Moving Average Convergence Divergence (MACD) with signal line and histogram
- Relative Strength Index (RSI)
- Average True Range (ATR) for volatility measurement
- True Range and other volatility metrics
-
Whale Activity Detection: Identifies potential "whale" trades by analyzing volume spikes relative to a rolling average, flagging unusual trading activity that could indicate large institutional moves.
-
Market Trend Analysis: Determines bullish/bearish market conditions based on MACD histogram and tracks trend continuations.
-
Interactive Visualization: Creates multi-panel charts using Plotly, including:
- Candlestick charts with overlaid indicators
- Colored trend periods (green for bull, red for bear)
- Subplots for ATR and RSI
- Whale alert markers on price charts
-
Performance Metrics: Calculates 24-hour, 30-day, and 90-day performance statistics, including highs, lows, and volatility spans.
In the volatile and fast-moving cryptocurrency markets, institutional traders need tools that can process large amounts of data quickly, identify patterns, and provide actionable insights. This project addresses several key needs:
- Quantitative Analysis: Provides objective, data-driven insights rather than relying on subjective analysis.
- Risk Management: ATR and volatility metrics help assess market risk and position sizing.
- Trend Identification: MACD and EMA indicators help identify market trends and potential entry/exit points.
- Anomaly Detection: Whale detection alerts traders to significant market-moving events.
- Visualization: Interactive charts allow for quick interpretation of complex data sets.
The project was developed to bridge the gap between raw market data and actionable trading intelligence, specifically tailored for crypto markets where traditional financial tools may not suffice.
What sets this project apart from other crypto analysis tools:
-
Comprehensive Indicator Suite: Combines multiple indicators in a single, cohesive analysis framework, allowing for cross-validation of signals.
-
Whale Detection Algorithm: A proprietary volume-based anomaly detection system that flags potential large trades, which is crucial in crypto markets where whales can significantly impact prices.
-
Multi-Timeframe Analysis: Simultaneously analyzes data across different time scales (1-min to daily), providing a holistic view of market dynamics.
-
Real-Time Data Integration: Fetches live data from Coinbase API, ensuring analysis is based on the most current market information.
-
Interactive Visualizations: Uses Plotly for web-based, interactive charts that can be embedded in dashboards or shared with team members.
-
Iterative Development: Started as a basic script and evolved with advanced features, demonstrating a scalable approach to quantitative tool development.
-
Open-Source Accessibility: While built with institutional tools, the project is shared openly, making advanced quantitative techniques accessible to retail traders and developers.
The project is structured as a Jupyter Notebook (coinbase-nb.ipynb) for easy execution and modification. Here's a breakdown of its components:
- Imports necessary libraries: pandas, requests, numpy, plotly
- Defines constants for currencies, granularities, and colors
- Establishes connection functions for API calls
connect(): Generic function for API requests with error handlingget_historic_data(): Fetches historical candle data from Coinbase- Server time synchronization for accurate data retrieval
- Retrieves available trading pairs from Coinbase
- Filters for user-specified cryptocurrencies
- Fetches 24-hour statistics for each currency
- Calculates performance metrics and formats for display
- Aggregates data across multiple timeframes
- Processes and cleans raw API data into structured DataFrames
- Implements technical analysis functions:
- Moving averages (SMA, EMA)
- MACD with signal and histogram
- RSI for momentum
- ATR for volatility
- True Range calculations
detect_whale_activity(): Identifies volume spikes above a threshold- Flags potential large trades for further analysis
- Creates candlestick charts with indicator overlays
- Adds trend coloring based on bull/bear conditions
- Generates multi-panel subplots for comprehensive analysis
- Computes performance statistics across timeframes
- Identifies trend continuations and market phases
The project requires the following Python packages (listed in requirements.txt):
- pandas
- requests
- numpy
- plotly
- Install dependencies:
pip install -r requirements.txt - Open the Jupyter notebook:
jupyter notebook coinbase-nb.ipynb - Run cells sequentially to fetch data, calculate indicators, and generate visualizations
- Customize parameters (currencies, timeframes, thresholds) as needed
Potential areas for expansion:
- Integration with additional exchanges
- Machine learning models for price prediction
- Real-time alerting system
- Portfolio optimization features
- Backtesting framework
This project is open-source and welcomes contributions. Please submit pull requests or issues via the GitHub repository.
For questions or collaborations, please reach out to the project maintainer. @rimerizha@gmail.com