Skip to content

AI Trading Bot leveraging advanced machine learning, multi-factor regime detection, and adaptive risk management. Includes feature engineering, backtesting, and interactive dashboards for quantitative trading.

License

Notifications You must be signed in to change notification settings

Aadityavarier/AI-Trading-Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Trading Bot

Build Status Python Version License: MIT Last Commit


Table of Contents


Overview

The AI Trading Bot is a state-of-the-art, institution-grade algorithmic trading system built using cutting-edge machine learning techniques and advanced quantitative finance methodologies. This comprehensive solution is designed for robust, adaptive, and highly customizable trading across asset classes.


Features

  • Multi-dimensional regime detection: Volatility, trend, momentum, and market stress regimes for optimized market entry/exit.
  • Advanced feature engineering: Technical indicators, market microstructure signals, cross-asset correlations, and time-based cyclical features.
  • Machine Learning pipeline: Ensembled classifiers (Random Forest, ExtraTrees, XGBoost) with calibrated probability outputs.
  • Dynamic thresholding: Regime-based and adaptive threshold optimizers for dynamic entry criteria.
  • Risk management: Kelly criterion-based position sizing, adaptive stop-loss/take-profit, trailing stops, and sophisticated drawdown control.
  • Comprehensive backtesting: Realistic trading simulation with transaction cost models (brokerage, taxes, market impact).
  • Extensive performance metrics: CAGR, Sharpe, Sortino, Omega ratios, drawdowns, and detailed trade statistics.
  • Interactive visualizations: Plotly dashboards for performance, risk, trade analysis, and heatmaps.
  • Modular and configurable: Customize via config files for risk parameters and model settings.

Technology Stack

  • Python 3.11
  • NumPy, Pandas, Numba (performance, data manipulation)
  • Scikit-learn, XGBoost, LightGBM (machine learning)
  • yFinance (financial data)
  • Plotly (interactive visualizations)

Project Structure

AI-Trading-Bot/
├── Trading_Bot
├── reports/
│   └── [visual analysis reports]
├── .github/
│   └── workflows/
|       └──python-ci.yml
├── requirements.txt
├── readme.md
└── license

Installation & Setup

Prerequisites

  • Python 3.11 or higher

Install dependencies

pip install -r requirements.txt

Configuration

Adjust trading parameters, risk tolerance, target volatility, etc. in the config file.

Default:

risk_tolerance: 0.02
target_volatility: 0.15
max_drawdown: 0.12
trading_horizon: 'daily'
position_sizing: 'kelly'
asset: 'RELIANCE'
years: 5

Usage

  1. Configure parameters in config/TradingConfig.yaml.
  2. Run the analysis:
python main.py
  1. Output reports and interactive dashboards are saved with versioned timestamps under /reports along with full logs.

Default: Runs analysis on RELIANCE stock over 5 years, generating detailed performance reports and dashboards.


Performance

  • Demonstrated predictive signal quality with AUC > 0.55
  • Controlled drawdown levels below 12%
  • Configurable trading horizons and position sizing

Visualization

Performance Dashboard Trade Analysis Risk Heatmap Drawdown Profile


Example Output

======================
 AI TRADING BOT ANALYSIS - RELIANCE
==========================================================================================
SIGNAL QUALITY ASSESSMENT:
  Model AUC:        0.559
  Model Accuracy:   0.546
   SIGNAL STRENGTH: STRONG - Good predictive power

 STRATEGY PERFORMANCE:
  Total Return:     7.66%
  Sharpe Ratio:     -2.069
  Win Rate:         71.0%
  Number of Trades: 53
  Max Drawdown:     -0.57%
OVERALL ASSESSMENT:
PROMISING: Good signals but execution needs work

Extensibility

  • Easily extend feature engineering by adding new indicators in FeatureBuilder.
  • Customize ML models or add new algorithms in models/.
  • Plug in alternative data sources or live data feeds.
  • Expand backtesting for other asset classes.

Contributing

Contributions, bug reports, and feature requests are welcome!

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/fooBar).
  3. Commit your changes (git commit -am 'Add some fooBar').
  4. Push to the branch (git push origin feature/fooBar).
  5. Open a Pull Request.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Author

Developed by Aaditya V — Aspiring Quantitative Engineer and AI Enthusiast

For queries or collaboration opportunities, please reach out via GitHub or email: [email protected]

About

AI Trading Bot leveraging advanced machine learning, multi-factor regime detection, and adaptive risk management. Includes feature engineering, backtesting, and interactive dashboards for quantitative trading.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published