CryptoView Pro uses state-of-the-art machine learning models to predict cryptocurrency prices across multiple time horizons, from 1 hour to 1 year. The system employs three distinct models optimized for different prediction scenarios:
XGBoost: Optimized for short-term predictions (1h - 72h)
Prophet: Designed for medium to long-term predictions (1 week - 1 year)
Hybrid Model: Intelligently combines both models for optimal accuracy
The system automatically recommends the best model based on your prediction horizon:
if forecast_hours <= 72: recommended_model = "XGBoost" # High accuracy for short-termelif forecast_hours <= 720: recommended_model = "Hybrid" # Best of both worldselse: recommended_model = "Prophet" # Handles long-term trends
The system automatically fetches historical OHLCV data from Kraken:
from data.collectors import CryptoDataCollectorcollector = CryptoDataCollector('kraken')df = collector.fetch_ohlcv('BTC/USDT', '1h', limit=2000)
2
Initialize Predictor
Choose your prediction model:
from models.hybrid_model import HybridCryptoPredictorfrom models.xgboost_model import XGBoostCryptoPredictorfrom models.prophet_model import ProphetCryptoPredictor# For optimal results, use the hybrid modelpredictor = HybridCryptoPredictor()# Or use specific modelsxgb_predictor = XGBoostCryptoPredictor( n_estimators=200, learning_rate=0.07, max_depth=6)
3
Train the Model
Train on historical data:
# Train hybrid model (trains both XGBoost and Prophet)training_info = predictor.train(df)print(f"Data points used: {training_info['data_points']}")print(f"XGBoost metrics: {training_info['xgboost']}")print(f"Prophet metrics: {training_info['prophet']}")
4
Generate Predictions
Predict future prices:
# Predict next 24 hourspredictions = predictor.predict_future(df, periods=24)# For hybrid model, predictions is a dict with multiple modelsbest_prediction = predictions['hybrid'] # or 'recommended'print(best_prediction.head())# Output:# predicted_price lower_bound upper_bound# 2026-03-07 12:00:00 94532.45 93821.23 95243.67# 2026-03-07 13:00:00 94612.89 93899.12 95326.66
from models.xgboost_model import XGBoostCryptoPredictor# Custom configurationpredictor = XGBoostCryptoPredictor( n_estimators=200, # Number of boosting rounds learning_rate=0.07, # Step size shrinkage max_depth=6, # Maximum tree depth subsample=0.8, # Subsample ratio of training data colsample_bytree=0.8 # Subsample ratio of features)# Train with custom splitmetrics = predictor.train(df, train_size=0.8) # 80% train, 20% testprint(f"Test MAE: ${metrics['test_mae']:.2f}")print(f"Test MAPE: {metrics['test_mape']:.2f}%")print(f"Direction Accuracy: {metrics['test_direction_accuracy']:.2f}%")# Get feature importanceimportance = predictor.get_feature_importance()print("\nTop 10 Features:")print(importance.head(10))
from models.hybrid_model import HybridCryptoPredictorpredictor = HybridCryptoPredictor()predictor.train(df)# Predict with automatic model selectionpredictions = predictor.predict_future(df, periods=72)# Check which models were usedif 'weights' in predictions: weights = predictions['weights'] print(f"XGBoost: {weights['xgboost']:.1%}") print(f"Prophet: {weights['prophet']:.1%}")# Get best predictionbest = predictor.get_best_prediction(predictions)# Compare all modelsfor model_name in ['xgboost', 'prophet', 'hybrid']: if model_name in predictions: pred_df = predictions[model_name] final_price = pred_df['predicted_price'].iloc[-1] print(f"{model_name}: ${final_price:,.2f}")
Uncertainty increases with prediction horizon. Short-term predictions (1-24h) typically have ±2-5% bands, while long-term predictions (30+ days) can have ±15-30% bands.