AI-powered financial prediction platform with continuous ensemble machine learning model training
DISCLAIMER: This software is for educational and research purposes only. NOT financial advice. You are solely responsible for your investment decisions.
- Overview
- Features
- Quick Start
- Installation
- Usage
- Continuous Training
- Architecture
- Contributing
- License
ARA AI is a financial prediction platform that combines ensemble machine learning models to provide price predictions for stocks and forex. The system uses:
- Ensemble Learning: XGBoost, LightGBM, Random Forest, Transformers, CNN-LSTM
- Continuous Training: Models retrain every 2 hours with latest market data
- Experiment Tracking: Weights & Biases integration for monitoring
- Model Storage: Hugging Face Hub for versioning and distribution
- Automated Training: 12 training cycles daily (every 2 hours)
- Random Stock Selection: 5 different stocks per cycle from 6,800+ tickers
- Robust Forex Pairs: EURUSD, GBPUSD, USDJPY
- Incremental Learning: Models improve continuously with new data
- Model Versioning: All models stored on Hugging Face Hub
- Ensemble Models: Combines 9+ different algorithms
- Transformer Architecture: Attention-based time series prediction
- CNN-LSTM Hybrid: Convolutional-recurrent neural networks
- Incremental Training: Continuous model improvement
- Adaptive Learning: Models adjust to market conditions
- 44+ Indicators: RSI, MACD, Bollinger Bands, ATR, and more
- Pattern Recognition: Head & Shoulders, Triangles, Wedges
- Volume Analysis: OBV, MFI, VWAP
- Trend Indicators: SMA, EMA, ADX, Parabolic SAR
- Volatility Measures: Bollinger Bands, Keltner Channels, ATR
- 2 Years Historical Data: Comprehensive training dataset
- Real-time Updates: Latest market data fetched before each training cycle
- Multi-asset Support: Stocks and forex pairs
- Automatic Scheduling: GitHub Actions handles all training
- Python 3.9 or higher
- pip package manager
- Git
# Clone the repository
git clone https://github.com/MeridianAlgo/AraAI.git
cd AraAI
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtfrom huggingface_hub import hf_hub_download
# Download a stock model
model_path = hf_hub_download(
repo_id="MeridianAlgo/ARA.AI",
filename="models/stock_AAPL.pt"
)
# Download a forex model
forex_path = hf_hub_download(
repo_id="MeridianAlgo/ARA.AI",
filename="models/forex_EURUSD.pt"
)pip install -r requirements.txtpip install -r requirements.txt
pip install pytest black flake8 mypydocker build -t ara-ai .
docker run -p 8000:8000 ara-aiMain dependencies:
- torch, transformers - Deep learning
- scikit-learn, xgboost, lightgbm - Machine learning
- pandas, numpy - Data manipulation
- yfinance - Market data
- wandb - Experiment tracking
- huggingface_hub - Model storage
See requirements.txt for complete list.
from meridianalgo.unified_ml import UnifiedStockML
from huggingface_hub import hf_hub_download
# Download model from Hugging Face
model_path = hf_hub_download(
repo_id="MeridianAlgo/ARA.AI",
filename="models/stock_AAPL.pt"
)
# Load and predict
ml = UnifiedStockML(model_path=model_path)
prediction = ml.predict('AAPL', days=5)
print(f"Current Price: ${prediction['current_price']}")
print(f"5-Day Prediction: ${prediction['predictions'][4]['price']}")from meridianalgo.forex_ml import ForexML
from huggingface_hub import hf_hub_download
# Download model
model_path = hf_hub_download(
repo_id="MeridianAlgo/ARA.AI",
filename="models/forex_EURUSD.pt"
)
# Load and predict
forex_ml = ForexML(model_path=model_path)
prediction = forex_ml.predict('EURUSD', days=5)
print(f"Prediction: {prediction}")# Train a stock model
python scripts/train_model.py \
--symbol AAPL \
--db-file training.db \
--output models/stock_AAPL.pt \
--epochs 100 \
--use-all-data
# Train a forex model
python scripts/train_forex_model.py \
--pair EURUSD \
--db-file training.db \
--output models/forex_EURUSD.pt \
--epochs 100 \
--use-all-dataModels are automatically trained every 2 hours via GitHub Actions:
- Pull: Download existing models from Hugging Face
- Select: Choose 5 random stocks + 3 forex pairs
- Fetch: Get latest 2 years of market data
- Train: Incrementally train models (50 epochs)
- Push: Upload updated models to Hugging Face
- Track: Log metrics to Weights & Biases
- Frequency: Every 2 hours (12 cycles daily)
- Stock Models: 5 random stocks per cycle (60 different stocks daily)
- Forex Models: EURUSD, GBPUSD, USDJPY (36 training sessions daily)
- Total: 96 model updates per day
- Per stock: 5-10 minutes
- Per forex pair: 5-10 minutes
- Total per cycle: 30-60 minutes
- Buffer: 60+ minutes before next cycle
-
Add
HF_TOKENto GitHub repository secrets (required)- Go to Settings → Secrets and variables → Actions
- Add new secret with your Hugging Face API token
-
Add
WANDB_API_KEYto GitHub repository secrets (optional)- For experiment tracking on Weights & Biases
- Models: https://huggingface.co/MeridianAlgo/ARA.AI
- Experiments: https://wandb.ai/your-username/ara-ai
- Workflow Runs: GitHub Actions tab in repository
AraAI/
├── .github/workflows/
│ └── daily-training.yml # Continuous training workflow
├── meridianalgo/ # Core ML algorithms
│ ├── unified_ml.py # Stock prediction system
│ ├── forex_ml.py # Forex prediction system
│ ├── torch_ensemble.py # PyTorch ensemble models
│ └── ...
├── scripts/ # Training scripts
│ ├── train_model.py # Stock model training
│ ├── train_forex_model.py # Forex model training
│ ├── fetch_training_data.py # Data fetching
│ ├── store_training_data.py # Data storage
│ └── select_random_tickers.py # Random ticker selection
├── models/ # Trained model files
│ └── README.md # Model documentation
├── ara/ # ARA package (optional)
├── requirements.txt # Python dependencies
├── LICENSE # MIT License
└── README.md # This file
- train_model.py: Train stock prediction models
- train_forex_model.py: Train forex prediction models
- fetch_training_data.py: Fetch market data from Yahoo Finance
- store_training_data.py: Store data in SQLite database
- select_random_tickers.py: Select random stocks from all_tickers.txt
The system uses a multi-layer ensemble:
-
Base Models
- XGBoost
- LightGBM
- Random Forest
- Gradient Boosting
- Extra Trees
- AdaBoost
-
Deep Learning
- Transformer (attention-based)
- CNN-LSTM (hybrid)
-
Ensemble
- Weighted averaging
- Confidence-based selection
We welcome contributions! Please:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests:
pytest tests/ -v - Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Open a Pull Request
# Format code
black scripts/ meridianalgo/
# Lint code
flake8 scripts/ meridianalgo/ --max-line-length=100
# Type checking
mypy scripts/ meridianalgo/This project is licensed under the MIT License - see LICENSE for details.
IMPORTANT: This software is for educational and research purposes only.
- NOT financial advice
- Past performance ≠ future results
- All predictions are probabilistic
- You are solely responsible for investment decisions
- Consult qualified financial professionals
- Authors are not liable for financial losses
- Scikit-learn (BSD License)
- XGBoost (Apache License 2.0)
- LightGBM (MIT License)
- PyTorch (BSD License)
- Transformers by Hugging Face (Apache License 2.0)
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Models: Hugging Face Hub
Maintained by: MeridianAlgo
Last Updated: 2025-12-22
Version: 5.2.0