"Hyperion is not just code. It's the answer to a challenge that completely captivated me. It's the tool I wish I had when I started."
(This is still a beta version - not all parts of the bot are working perfectly yet, but as more days pass, I realize it will never be as perfect as I dream, so I decided to show what's been developed. In the coming days, I'll fix the remaining errors and implement all the features. Thanks for reading, I hope to be up to the challenge)
|
Hyperion is a RESEARCH and LEARNING tool, NOT a money-making machine.
Algorithmic trading requires deep knowledge, risk management, and understanding that losses are part of the game. |
Hello, I'm the creator of Hyperion. Giovanni, but I prefer to be called Ganador (Winner). Let me tell you a story.
I always dreamed of creating a trading bot that operated autonomously, an intelligent machine capable of navigating the turbulent seas of the market. When I started, my naivety made me think it would be an easy task. I believed that in a couple of weekends I would have something working.
How wrong I was.
I soon came face to face with reality: building a cutting-edge bot, starting from scratch and alone, is a colossal challenge. I immersed myself in an ocean of research papers, model architectures, and preprocessing techniques, and each new layer of knowledge revealed ten more that I didn't know.
When looking for help, I realized that the landscape of public and free trading bots was bleak. Most were too simple, black boxes without flexibility, or directly useless. I felt immense frustration. How could someone, with more desire than experience, start in this world?
It was in that moment of frustration and challenge that Hyperion was born. I decided that if the tool I needed didn't exist, I would build it myself.
This project is the result of countless hours of work, trial and error, small failures and great victories. My most sincere hope is that Hyperion saves you part of that difficult path and gives you the power so that you too can transform your ideas into real strategies.
# 1. Start the professional system (RECOMMENDED)
pip install -r requirements.txt
python main.py
# 2. Access the professional interface directly
python main_professional.py
# 3. Validate the modular structure
python test_modular_structure.pyHyperion is designed as a modular and automated pipeline that transforms raw market data into robust and validated trading strategies. The entire process is controlled from a single configuration file (config.json), simplifying a workflow that would otherwise be extremely complex.
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ Config โ -> โ Data โ -> โPreprocessor โ -> โ Model โ
โ (config.json)โ โ Downloader โ โ& Features โ โ Trainer โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ
v
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
โ MLOps โ <- โ Backtester โ <- โ Ensemble โ <- โ Hyperopt โ
โ Tracking โ โ& Validation โ โ Creation โ โ (FLAML) โ
โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโ
The Brain of the Operation: Here you define everything: the cryptocurrency pair (e.g., BTC/USDT), the time interval (1h, 4h, 1d), start and end dates, and most importantly: the list of models you want to test and the optimizer configuration.
Hyperion connects to data sources and downloads the OHLCV (Open, High, Low, Close, Volume) price history for the asset you specified. Data is saved locally for quick access and reuse.
Cleaning and Preparation: Raw data is cleaned of missing values and prepared for analysis.
Intelligence Creation: Here's where the magic happens! Hyperion doesn't just use price. It generates an arsenal of more than 100 features to give models deep market context:
- ๐ Momentum Indicators: RSI, Stochastic, MACD, Williams %R
- ๐ Trend Indicators: Moving Averages (SMA, EMA), Bollinger Bands, ADX, Ichimoku Cloud, Vortex
- ๐จ Volatility Indicators: ATR (Average True Range), Keltner Channels
- ๐ Volume Analysis: On-Balance Volume (OBV)
- ๐ฏ๏ธ Japanese Candlestick Patterns: Doji, Engulfing, Hammer, etc.
- ๐ญ Data Augmentation: To avoid overfitting, synthetic variations of the data are created
The Search for Perfection: Hyperion features a sophisticated multi-engine optimization system that automatically discovers optimal parameters for 50+ models across multiple categories.
- ๐ฅ Optuna: Bayesian optimization with TPE (Tree-structured Parzen Estimator) sampler for intelligent parameter space exploration
- โก FLAML: Microsoft's AutoML framework for rapid optimization with resource constraints
- ๐ง Scikit-learn: Traditional GridSearch/RandomSearch for comprehensive parameter coverage
- ๐ฒ TPOT: Genetic programming for automated pipeline optimization
๐ณ Scikit-learn Models (35+ algorithms):
- Tree-based: RandomForest, GradientBoosting, ExtraTrees, AdaBoost, Bagging, HistGradientBoosting
- Linear Models: Ridge, Lasso, ElasticNet, BayesianRidge, ARDRegression, HuberRegressor, TheilSenRegressor, RANSACRegressor
- SVM Variants: SVR, NuSVR, LinearSVR with RBF/Polynomial/Linear kernels
- Neural Networks: MLPRegressor with customizable architectures
- Advanced: GaussianProcess, KernelRidge, QuantileRegressor, TweedieRegressor, PoissonRegressor, GammaRegressor
โก Gradient Boosting Libraries:
- XGBoost: Full parameter space optimization with GPU acceleration support
- LightGBM: High-performance boosting with memory-efficient optimization
- CatBoost: Categorical feature handling with automatic GPU detection
๐ง Deep Learning Models:
- PyTorch: SimpleMLP, DeepMLP, LSTM networks with architecture optimization
- Transformers: Temporal Fusion Transformer (TFT), PatchTST with attention mechanism tuning
- Custom: Neural architecture search for optimal layer configurations
๐ฎ Reinforcement Learning Agents:
- SAC (Soft Actor-Critic): Continuous action spaces with entropy regularization
- TD3 (Twin Delayed DDPG): Policy gradient methods with noise injection
- Rainbow DQN: Multi-improvement DQN with distributional learning
# Comprehensive optimization example
from utils.hyperopt import HyperparameterOptimizer
# Initialize with GPU configuration
optimizer = HyperparameterOptimizer(
console=console,
gpu_config={
'xgboost_params': {'tree_method': 'gpu_hist'},
'lightgbm_params': {'device': 'gpu'},
'catboost_params': {'task_type': 'GPU'}
}
)
# Optimize all 50+ models
results = optimizer.optimize_all_models(
X_train, y_train, X_val, y_val,
n_trials=100 # Bayesian optimization trials
)
# Category-specific optimization
sklearn_best = optimizer.optimize_sklearn_models(X_train, y_train, X_val, y_val, n_trials=50)
rl_best = optimizer.optimize_rl_agents(X_train, y_train, X_val, y_val, n_trials=30)- Dynamic ranges: Parameters automatically adjusted based on dataset characteristics
- Model-specific constraints: Each algorithm has tailored parameter boundaries
- Multi-objective: Simultaneous optimization for accuracy, speed, and memory usage
- Early stopping: Intelligent trial pruning with Optuna's median stopping
- Cross-validation: Integrated CV for robust hyperparameter validation
The Wisdom of the Crowd: Instead of relying on a single "genius", Hyperion can combine the predictions of your best models in an ensemble. This often leads to more stable and robust decisions.
The Trial by Fire: The Backtester simulates how your strategy would have performed in the past, trade by trade. It provides you with critical metrics like Total Return, Sharpe Ratio, Maximum Drawdown, and hit rate.
Reproducibility and Transparency: Every detail of your experiment is automatically recorded with MLflow. This allows you to compare different approaches and return to any point in your research without getting lost.
Hyperion integrates an exceptionally diverse model library, allowing you to approach the problem from multiple angles. All models are instantiated through hyperion3/models/model_factory.py.
- Prophet: Developed by Facebook, excellent for capturing seasonalities and trends robustly
The backbone of modern data science. They are fast, interpretable, and very powerful:
- ๐ LightGBM: The fastest option. Uses extremely efficient leaf-wise growth
- ๐ XGBoost: The gold standard. Famous for its performance and anti-overfitting regularization
- ๐ฏ CatBoost: Specially designed to handle data efficiently, very robust
- ๐ฒ RandomForest and ExtraTrees: Ensembles of multiple trees to improve robustness
Specifically designed to capture complex temporal dependencies:
- ๐ N-BEATS: Decomposes the time series into interpretable components
- โก N-HITS: Evolution of N-BEATS with better efficiency and frequency spectrum
- ๐ฅ TFT (Temporal Fusion Transformer): Fuses different types of data with attention mechanisms
- ๐ PatchTST (Transformer): The crown jewel! Based on Google's Transformer architecture, processes the time series in "patches" to capture short and long-term relationships
The most radical paradigm shift. Instead of predicting the future, agents learn to act to maximize rewards:
- ๐ญ SAC (Soft Actor-Critic): Modern, efficient and very stable algorithm
- ๐ฏ TD3 (Twin Delayed DDPG): Robust, designed to mitigate value overestimation
- ๐ Rainbow DQN: Improvement of the classic DQN that combines multiple techniques
How does RL work? The agent is the "trader". It observes the market and decides actions (buy/sell/hold). If it wins, it receives positive reward. After thousands of simulations, it learns a policy to maximize profits. It's the closest thing to teaching an AI to "think" like a trader.
Hyperion3 features a complete professional interface:
- ๐ค MODELS: Train individual models by category (sklearn, ensemble, pytorch, automl)
- ๐ฏ HYPERPARAMETERS: Automatic and manual hyperparameter optimization
- ๐ญ ENSEMBLES: Create and manage ensembles (voting, weighted, stacking, bagging)
- ๐ ANALYSIS: Complete analysis of results and performance metrics
- โ๏ธ CONFIGURATION: System configuration management
- ๐ MONITORING: Real-time system monitoring
# Train specific models
s1, s2, s3... # sklearn models (Random Forest, Gradient Boosting, etc.)
e1, e2, e3... # ensemble models (XGBoost, LightGBM, CatBoost)
p1, p2, p3... # pytorch models (MLP, LSTM, Transformer)
a1, a2... # automl models (FLAML, Optuna)
# Train by category
sklearn, ensemble, pytorch, automl
# Train all models
allpip install -r requirements.txt./install_mac.sh- Python 3.8+
- Unix OS (Linux or macOS recommended)
- Optional: GPU with CUDA for deep learning models
See docs/INSTALLATION.md for detailed instructions.
The code is organized in modular packages:
hyperion3/models/โ transformers and RL agentshyperion3/training/โ training loops and callbackshyperion3/evaluations/โ backtester and financial metricshyperion3/optimization/โ AutoML utilities with FLAMLhyperion3/data/โ downloaders, preprocessing and feature engineeringscripts/deployment/โ live trading engine and monitoringscripts/โ auxiliary commands for training and testingdocs/โ additional documentation
- ๐จ Rich UI: Beautiful console interface with Rich library
- ๐ง Modular Design: Clean separation in utils/ modules
- โก Performance: Optimized for Apple Silicon (MPS) and CUDA
- ๐พ Auto-Save: Automatic saving of models, results and configurations
- ๐ Analytics: Integrated analysis and comparison tools
- ๐ Real-time data with Binance API
- ๐งช Advanced backtesting with multiple strategies
โ ๏ธ Risk management and portfolio optimization- ๐ฌ MLOps integration with experiment tracking
- โฐ Multi-timeframe analysis and prediction
Raw datasets reside in data/. Use the provided preprocessing scripts to generate features and augmentations. The DataConfig class controls symbols, lookback windows, and additional data sources like sentiment, orderbook, or on-chain metrics.
See docs/DATA_MANAGEMENT.md for a complete tutorial.
Additional guides available in the docs/ directory:
BACKTESTER.mdโ advanced backtesting engineEXPERIMENTS.mdโ running configurable experimentsVALIDATORS.mdโ cross-validation helpersINSTALLATION.mdโ detailed installation instructionsDEVELOPMENT_GUIDE.mdโ development guide
Hyperion is a living and constantly evolving project. If you're passionate about this world, your help is welcome. You can contribute:
- ๐ Reporting bugs via Issues
- ๐ก Suggesting new features
- ๐ง Adding your own code via Pull Requests
- ๐ Improving documentation
- ๐งช Sharing experiment results
The project structure is modular, which facilitates adding new models, metrics, or data processors.
- Fork the repository
- Create a branch for your feature (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Make sure all tests pass before submitting.
This project is published under the terms of the Apache 2.0 License. See LICENSE for more details.
Thanks to the open source community and all the researchers whose work has made Hyperion possible.
โจ Ready to transform your ideas into real strategies? Start your journey with Hyperion today!
git clone https://github.com/your-username/hyperion.git
cd hyperion
pip install -r requirements.txt
python main.pyThanks for reading to the end. This is my first project and I hope this and the following ones I work on can be useful.
๐ Documentation available in multiple languages: