Nicholas Khorasani

Computer Engineer | Software Engineer

Automated Forex Trading Bot

June 2022 – July 2022

TLDR

  • Collected historical and live FX price data from the OANDA API for EUR/USD, GBP/USD, and other pairs.
  • Built a Python backtesting pipeline with pandas to evaluate strategies over rolling windows and walk-forward periods.
  • Implemented an automated strategy that places trades on crossings of multiple rolling moving averages and technical indicators.
  • Containerized the bot with Docker and deployed it on an AWS EC2 instance for 24/7 execution.

Project Overview

The system ingests tick/minute data from OANDA, computes rolling moving averages and indicators in pandas, and triggers market orders when crossover conditions are met. A small backtester replays historical data to measure hit rate and drawdown

In production, the bot runs inside a Docker container on an EC2 instance and polls prices at fixed intervals. Positions and PnL snapshots are logged for later analysis.

What I Learned

  1. Time-series data engineering in pandas: resampling, rolling windows, and vectorized computations.
  2. Practical deployment: packaging with Docker and running on AWS EC2.
  3. Working with broker APIs (OANDA): Managing authentication and rate limits.
  4. How many edge cases can break a trading bot: handling missing data, API errors, and unexpected market conditions.