Overview
CryptoView Pro provides a flexible architecture for creating custom prediction models. This guide shows you how to extend the existing XGBoost, Prophet, and Hybrid model classes to build specialized predictors tailored to your trading strategy.Model Architecture
Model Class Structure
All models in CryptoView Pro follow a consistent interface:train(df)- Train the model on historical datapredict_future(df, periods)- Generate future predictions- Feature engineering - Transform raw OHLCV data into ML features
- Validation - Built-in backtesting and metrics
Extending XGBoost Models
Basic Custom XGBoost Model
The XGBoost predictor uses gradient boosting for short-term predictions (1-72 hours). Here’s how to extend it:Adding Custom Trading Signals
Extending Prophet Models
Custom Prophet with Additional Regressors
Prophet excels at long-term forecasting (1 week - 1 month). Add external factors:Multi-Cryptocurrency Prophet Model
Creating Custom Hybrid Models
Adaptive Hybrid with Dynamic Weighting
Using Custom Models in the App
Integration Example
Best Practices
Feature Engineering
Feature Engineering
- Keep it simple first: Start with base features, add complexity gradually
- Domain knowledge: Use trading knowledge to create meaningful features
- Avoid leakage: Never use future information in features
- Handle NaN: Features with rolling windows create NaN at the start
- Scale appropriately: XGBoost handles unscaled features, but normalization can help
Model Selection
Model Selection
- XGBoost: Best for short-term (1-72h), high-frequency patterns
- Prophet: Best for long-term (1 week+), captures seasonality
- Hybrid: Best for medium-term (3 days - 2 weeks)
- Custom: When you have specific domain knowledge or data sources
Validation
Validation
- Time-series split: Never use random train/test split
- Walk-forward validation: Test on multiple out-of-sample periods
- Direction accuracy: More important than exact price for trading
- Backtest thoroughly: At least 3-6 months of historical data
Production Considerations
Production Considerations
- Save models: Use
joblib.dump(model, 'model.pkl')to persist - Versioning: Track model versions and parameters
- Monitoring: Log predictions vs actuals for performance tracking
- Retraining: Retrain weekly/monthly as market conditions change
- Fallback: Always have a backup model or strategy
Advanced: Custom Loss Functions
Next Steps
Feature Engineering
Deep dive into advanced feature engineering techniques
Production Deployment
Deploy your custom models to production
API Reference
Complete API documentation for all model classes
Examples
More custom model examples and use cases