Skip to content

Event-driven trading bot with SMA strategy, paper broker, trade logging, performance metrics, and visualization.

Notifications You must be signed in to change notification settings

chanchalkapri/event_driven_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📈 Event-Driven Trading Bot (Paper Trading)

A modular event-driven trading bot in Python that uses a simple SMA crossover strategy to simulate trades in real-time. This bot fetches live data, makes decisions, executes simulated orders, logs trades, evaluates performance, and visualizes buy/sell signals.


🚀 Features

  • ✅ Event-driven execution using live streamed OHLC data
  • ✅ SMA-based signal generator (Simple Moving Average)
  • ✅ Custom paper broker for simulating orders and cash
  • ✅ Trade history logging to CSV
  • ✅ Performance summary (total return, win rate, average PnL)
  • ✅ Clean chart with price, SMA, and buy/sell signal markers

📈 Strategy Chart

Strategy Chart

The bot places simulated BUY (🟢) and SELL (🔴) signals on the price chart based on SMA crossover logic.


🧠 Strategy Logic

The strategy checks the live price stream and compares it with a rolling Simple Moving Average (SMA):

  • 🟢 BUY when price crosses above the SMA
  • 🔴 SELL when price crosses below the SMA

This can be modified in strategy/simple_strategy.py to implement RSI, MACD, or other indicators.


📊 Performance Sample Output


⚙️ Installation

git clone https://github.com/chanchalkapri/event_driven_bot.git
cd event_driven_bot
pip install -r requirements.txt
python main.py

About

Event-driven trading bot with SMA strategy, paper broker, trade logging, performance metrics, and visualization.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages