Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Algo Trading Bot

A streamlined trading simulation engine. This bot uses Python for data management and visualization, while offloading strategy execution to C++ for high-speed, event-driven processing.

Features

Hybrid Power: Python's flexibility + C++'s execution speed.

Dual Strategies: Side-by-side comparison of Trend-Following vs. Mean-Reversion.

No Look-Ahead Bias: Event-driven C++ processes prices one-by-one.

External Analysis: Exports equity curves to .mat for Matlab integration.

Comparative Analysis:

This bot was tested across two distinct assets to compare strategy performance:

  • Apple - Trending Asset: The SMA Crossover performs better here. Because Apple tends to have long momentum runs, the trend-following logic captures the majority of the upside.
  • Gold - Mean-Reverting Asset: The Z-Score ±2σ strategy excels here. Gold often trades in ranges; by buying at -2σ and selling at +2σ, the bot profits from price "snap-backs" to the average.

Strategy Comparison Summary

Strategy Best For Logic Style
SMA 20/50 Trending Markets Momentum
Z-Score Sideways Markets Statistical Arbitrage

Prerequisites

Python 3.11+

G++ Compiler

Clone the repository

git clone https://github.com/parthh1415/Algo-Trading-Bot.git

cd Algo-Trading-Bot

Install dependencies

pip install -r requirements.txt

You must compile the C++ logic before running the bot:

g++ -O3 -shared -fPIC strategy.cpp -o libz.so

g++ -O3 -shared -fPIC smastrat.cpp -o libsma.so

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages