Automated Trading System
Project Overview
This Automated Trading Analysis, developed as part of my academic journey in CUS690 - Applied Analytics, showcases my hands-on approach to stock trading strategy optimization using historical data. The project leverages the pandas_datareader
API, and contains a StockTrader
class for trading individual stock data and PortfolioTrader
for managing multiple stocks within a portfolio. The progtam explores the fine-tuning of short_moving_average
and long_moving_average
values for a specified stock portfolio. This project allowed me to gain insights into basic trading strategy principles while practicing my data analysis and python development skills.
Strategy and Implementation
At its core, the PortfolioTrader
class conducts a grid search for each stock’s optimal short_moving_average
and long_moving_average
parameters within user-defined ranges, aiming to maximize returns over a trading period.
The trading strategy can be summarized as:
- Sell:
short_moving_average
crosses belowlong_moving_average
- Buy:
short_moving_average
crosses abovelong_moving_average
(after a sell) - Buy More:
short_moving_average
consistently stays abovelong_moving_average
The project’s focus is on maximizing returns by optimizing parameter values. Performance assessment includes logarithmic and arithmetic returns.
Trading Results and Analysis
Citigroup Stock Example | Disney Stock Example |
---|---|
More details and examples can be found on my github, below.