This project is part of a competition at WUTIS - Academic Trading And Investment Society, focusing on leveraging graph representations to understand and capitalize on group trends within stock market data. Our approach, recognized through a first-place victory in an Algorithmic Trading pitch competition, involves creating a dynamic graph representation based on the cross-correlation of stock price time-series data, identifying coherent and deviating group trends among stocks. More details are in the presentation file, with sample slides below:
![](https://private-user-images.githubusercontent.com/52599010/259897800-53396e03-41d0-4ae3-a073-1f83fda918cc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTIwMjQsIm5iZiI6MTczOTMxMTcyNCwicGF0aCI6Ii81MjU5OTAxMC8yNTk4OTc4MDAtNTMzOTZlMDMtNDFkMC00YWUzLWEwNzMtMWY4M2ZkYTkxOGNjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIyMDg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFiZTUwMTY0NjNlMzc2ZGM0YWQ0MmI4OTZhNDcxYzA3ZGVlOTZhZTM3ZWJkMmVmMmUyZTNkMzU5NGNlZTNmYjcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.lRo6dp2PORCxfhpeUMxQxGjN2cWhVnBZVxdfwB6re1I)
![](https://private-user-images.githubusercontent.com/52599010/259897820-3ddf0297-719b-44d5-b28b-fc531d5f47ba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMTIwMjQsIm5iZiI6MTczOTMxMTcyNCwicGF0aCI6Ii81MjU5OTAxMC8yNTk4OTc4MjAtM2RkZjAyOTctNzE5Yi00NGQ1LWIyOGItZmM1MzFkNWY0N2JhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjExVDIyMDg0NFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlhN2Q3NDQ4NTg4NTE5NmMwMzRmYTIyNjJlNTFlYzZlNDg3YzEyOTM2ZTc0ZGNkMmYzMWRhZTc5Mzg0MmJlYTcmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.j1prBMt8NFibyHIee2DJ4saSR0o5Exb6sWYE92kjCeg)
Our project is split into three sections:
1. data_collection_graph_analysis.ipynb - Collecting the data, constructing the representation graph and analyzing potential group parameters.
2. group_trends_trading_strategy.ipynb - Formulating a trading strategy around the stocks that deviate and potentially returning to group trends.
3. parameter_optimization_strategy.ipynb - Backtesting and ranking based on the historical data to find optimal parameters.
Data is downloaded from the yahoo finance Python library - https://pypi.org/project/yfinance/.
Python file where all used functions are stored - trading_functions.py