A comprehensive analysis tool to identify the best cryptocurrency for scalping/day trading based on multiple factors including volatility, liquidity, spread impact, and stability metrics.
- Multi-Factor Analysis: Considers volatility, liquidity, spread impact, and stability
- Real-Time Data: Fetches live market data via CCXT library
- Multi-Timeframe: Analyzes 5min, 10min, 15min, and 30min intervals
- Comprehensive Scoring: Weighted composite score for optimal trading pair selection
- Spread-Adjusted Metrics: Calculates net volatility after bid-ask spread
- Volume Analysis: Incorporates trading volume and liquidity metrics
- Stability Assessment: Evaluates volatility consistency over time
- Python 3.8 or higher
- Internet connection for fetching market data
-
Clone the repository
git clone https://github.com/imanhavangi/crypto-volatility-analysis.git cd crypto-volatility-analysis -
Create virtual environment
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
Default Analysis (Kraken Exchange)
python main.pyCustom Exchange
export EXCHANGE_ID=binance # or coinbase, bitfinex, bybit, okx
python main.pyπ RANKING SUMMARY (Exchange: KRAKEN)
------------------------------------------------------------
rank symbol composite_score raw_volatility net_volatility spread_pct volume_percentile
1 DOGE/USD 0.744 0.503% 0.493% 0.010% 90%
2 ADA/USD 0.708 0.529% 0.511% 0.017% 70%
3 XRP/USD 0.697 0.410% 0.398% 0.012% 80%
π TOP 3 DETAILED ANALYSIS
------------------------------------------------------------
#1 DOGE/USD
Composite Score: 0.744
Raw Volatility: 0.503%
Net Volatility (after spread): 0.493%
Efficiency Ratio: 0.98
Volume Percentile: 90%
Volatility Stability: 0.594
π‘ RECOMMENDATION
------------------------------------------------------------
π DOGE/USD appears to be the best choice for scalping on KRAKEN
| Component | Weight | Description |
|---|---|---|
| Raw Volatility | 25% | Price range volatility across timeframes |
| Efficiency | 25% | Net volatility after spread deduction |
| Stability | 25% | Consistency of volatility patterns |
| Liquidity | 25% | Trading volume and market depth |
- Data Collection: Fetches 30 days of 1-minute OHLCV data
- Spread Analysis: Estimates bid-ask spread from current market data
- Multi-Timeframe Resampling: Aggregates data into 5, 10, 15, 30-minute intervals
- Metric Calculation:
- Raw volatility:
(High - Low) / Mid Price - Net volatility:
Raw Volatility - Spread - Stability:
1 / (1 + Coefficient of Variation) - Volume percentile ranking across all symbols
- Raw volatility:
- Composite Scoring: Weighted combination of all metrics
The tool supports all exchanges available in the CCXT library:
- Major Exchanges: Binance, Coinbase, Kraken, Bitfinex, Bybit, OKX, Huobi
- Regional Exchanges: Bitstamp, Gemini, KuCoin, Gate.io
- Full List: CCXT Supported Exchanges
Edit the SYMBOLS list in main.py:
SYMBOLS = [
"BTC/USD", "ETH/USD", "BNB/USD", "SOL/USD", "XRP/USD",
"ADA/USD", "DOGE/USD", "SHIB/USD", "DOT/USD", "AVAX/USD",
# Add your preferred trading pairs
]Modify the WEIGHTS dictionary to prioritize different factors:
WEIGHTS = {
'volatility': 0.25, # Raw price volatility
'liquidity': 0.25, # Trading volume impact
'stability': 0.25, # Volatility consistency
'efficiency': 0.25, # Net volatility after spread
}Update the TIMEFRAMES list for different analysis intervals:
TIMEFRAMES = [5, 10, 15, 30] # MinutesHigher scores indicate better suitability for scalping/day trading.
Average percentage price range per timeframe window.
Volatility remaining after accounting for bid-ask spread costs.
Net Volatility / Raw Volatility - measures how much volatility is "usable" after spread.
Ranking of trading volume compared to other analyzed symbols (0-100%).
Measures consistency of volatility patterns. Higher = more predictable.
python -m pytest tests/black main.pymypy main.py- ccxt: Cryptocurrency exchange trading library
- pandas: Data manipulation and analysis
- numpy: Numerical computing
- typing: Type hints (Python 3.8+)
- Not Financial Advice: This tool is for educational and research purposes only
- Market Risk: Cryptocurrency trading involves substantial risk of loss
- Data Accuracy: Market data accuracy depends on exchange API reliability
- Past Performance: Historical volatility doesn't guarantee future results
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- CCXT for the excellent exchange integration library
- Pandas for powerful data analysis capabilities
- Cryptocurrency exchanges for providing market data APIs
If you encounter any issues or have questions:
- Check the Issues section
- Create a new issue with detailed description
- Include error messages and system information
β Star this repository if you find it useful!