Skip to main content
All projects

Algorithmic Trading Bot

tool·experimental·B.Tech Capstone Project·Jan 2025 — Present

Overview

A Python-based algorithmic trading research system built around the MetaTrader 5 platform. The project is structured as a modular pipeline for market-data processing, trade signal generation, risk management, and structured logging. It was developed as a B.Tech capstone project to investigate market-structure concepts such as fair-value gaps, liquidity analysis, and confluence scoring, with an emphasis on engineering rigor, diagnostics, and hypothesis-driven experimentation rather than live profitability. Currently focused on XAUUSDm, with BTCUSDm support implemented and maintained as a secondary instrument on standby.

Problem

Retail traders and researchers often lack transparent, well-structured tooling for testing trading hypotheses with proper risk controls and systematic logging. Existing solutions tend to obscure decision logic or lack the instrumentation needed to debug and iterate on strategy behavior.

Solution

Developed a modular Python system that automates market-data ingestion, signal evaluation, risk management, and trade logging within MetaTrader 5. The architecture separates concerns into discrete modules so individual hypotheses—such as fair-value-gap detection or session-based filtering—can be tested, instrumented, and compared without coupling to a monolithic script.

Architecture

Modular Python application organized around a central orchestrator with separate modules for market-data processing, market-structure analysis, risk management, and structured logging. MetaTrader 5 serves as the execution and data-feed environment, while PostgreSQL persists trade records and diagnostic outputs for offline analysis.

Technology stack

PythonMetaTrader 5PostgreSQLDocker

Screenshots

Algorithmic Trading Bot - dashboard
Algorithmic Trading Bot - Strategy
Algorithmic Trading Bot - Settings
Algorithmic Trading Bot - AI Copilot

Key features

  • Modular signal and market-structure analysis pipeline
  • Liquidity and fair-value-gap detection
  • Confluence scoring and session/news filtering
  • Volatility-adaptive stop-loss and partial-close logic
  • Structured trade logging and diagnostic tooling
  • PostgreSQL persistence for trade history and analytics

Challenges

  • Translating discretionary trading concepts into deterministic, testable modules
  • Managing state and position tracking across MetaTrader 5 bar events
  • Designing logging and diagnostics that reveal discrepancies between expected and observed behavior

Lessons learned

  • Modular architecture makes it possible to isolate and test individual strategy components
  • Structured logging is as important as the trading logic for understanding system behavior
  • Risk management and debugging infrastructure deserve as much design attention as signal generation

Future improvements

  • Expanded instrument coverage and multi-timeframe analysis
  • Automated performance reporting and hypothesis tracking
  • Visualization dashboard for strategy diagnostics