Prometheus is an algorithmic trading research platform that integrates with the Alpaca Markets API for trading strategies. This project combines data analysis, machine learning models, and market data analysis to support trading research and development.
- Published Academic Research: Successfully published "The Financial Torque Hypothesis: Predicting Short-Term Stock Price Movements Using LSTM Neural Networks" on SSRN, achieving over 87% accuracy in stock price movement predictions
- Comprehensive Data Infrastructure: Built extensive market data collection system supporting multiple feeds (IEX, SIP) with both regular trading hours and extended session data
- Interactive Research Platform: Developed a full-featured Streamlit web application for data visualization, model analysis, and research insights
- Multi-Strategy Framework: Implemented research notebooks for different trading approaches (Simons quantitative strategy, Sun Tzu tactical analysis)
- Machine Learning Integration: Successfully integrated TensorFlow-based LSTM neural networks with real market data for predictive modeling
- Open Source Contribution: Created a complete research platform with proper documentation, dependency management, and academic citations
- Next.js Frontend Migration: Transition from the current Streamlit-based frontend to a modern Next.js web application for enhanced performance, better user experience, and improved scalability
- Advanced Portfolio Management Research: Currently developing the second academic publication "Integrating The Financial Torque Hypothesis into Advanced Algorithmic Portfolio Management" which will detail practical implementation strategies and portfolio optimization techniques
- Enhanced Machine Learning Models: Expand the current LSTM framework to include additional deep learning architectures and ensemble methods
- Real-time Trading Integration: Develop production-ready trading execution capabilities with advanced risk management systems
- API Development: Create comprehensive REST APIs for third-party integrations and mobile applications
This project is supported by rigorous academic research published in peer-reviewed venues:
Authors: Guilherme Grancho Duarte Fernandes, Vasco V. R. Serpa Pereira
Abstract: This paper introduces the Financial Torque Hypothesis, which asserts that Volume-Weighted Average Price and Trade Count are critical indicators for predicting stock price movements. By incorporating these features into a Long Short-Term Memory Neural Network, our model achieved over 87% accuracy in predicting stock-price increases over a three-hour horizon, based on 21 months of previously unseen test data. We also perform a comprehensive comparative analysis of model performance using two datasets: one that spans the entire trading sessionβpre-market, regular-market and after-hoursβand one confined to regular-market hours. Our results reveal that models trained on full-session data consistently outperform those built on regular-hours-only data, delivering a 15% improvement in predictive accuracy.
Citation:
Fernandes, Guilherme Grancho Duarte and Pereira, Vasco, The Financial Torque Hypothesis:
Predicting Short-Term Stock Price Movements Using LSTM Neural Networks (June 20, 2025).
Available at SSRN: https://ssrn.com/abstract=5288444
Authors: Guilherme Grancho Duarte Fernandes, Vasco V. R. Serpa Pereira
Status: Set to be published in the coming months
This upcoming publication will detail the practical implementation of the Financial Torque Hypothesis within the Prometheus trading platform and its integration into advanced portfolio management strategies.
The project includes a Streamlit-based web application that provides:
- Portfolio Monitoring: Tracking of positions and performance metrics
- Strategy Visualization: Charts displaying strategy performance
- Risk Management Interface: Tools for monitoring and adjusting risk parameters
- Market Data Analysis: Data visualization and analysis tools
- Academic Research Integration: Access to research findings and model insights
Ensure Streamlit is installed (pip install streamlit
).
streamlit run frontend/my-streamlit-app/Home.py
The frontend application is located in the frontend/my-streamlit-app/
directory and serves as the primary user interface for interacting with the Prometheus trading platform.
-
Market Data Integration
- Integration with Alpaca Markets API
- Data collection with rate limit management
- Support for multiple timeframes and market data types (IEX, SIP)
-
Trading Research Models
- Machine learning model integration with TensorFlow
- Custom trading strategies research (Simons, Sun Tzu)
- Research-based approach with separate modules for different strategies
- Structured model management and evaluation (see
Models/
directory)
-
Data Analysis & Visualization
- Market data analysis using pandas and numpy
- Data visualization with matplotlib and plotly
- Performance metrics and reporting
- Historical data analysis and storage for various sources (see
Data/
directory)
-
Risk Management Research
- Position sizing algorithms research
- Stop-loss and take-profit mechanisms research
- Portfolio diversification strategies research
- Risk assessment tools research
-
Live Trading Research
- Jupyter notebook for live trading research and monitoring (see
Live_Trading/
directory)
- Jupyter notebook for live trading research and monitoring (see
-
Launching the Frontend Dashboard
Ensure Streamlit is installed (
pip install streamlit
).streamlit run frontend/my-streamlit-app/Home.py
-
Data Collection and Analysis
(Refer to notebooks within
Data/
subdirectories or specific strategy research)# Example: Initialize API connection (ensure credentials are set) import alpaca_trade_api as tradeapi api = tradeapi.REST( key_id='YOUR_API_KEY', # Preferably set via environment variables secret_key='YOUR_SECRET_KEY', # Preferably set via environment variables base_url='https://paper-api.alpaca.markets' ) # Example: Fetch market data # data = api.get_bars('AAPL', '1D', '2024-01-01', '2024-04-15').df # Original example # For more detailed data handling, see notebooks in Data/ or strategy research folders.
-
Runni 8000 ng Trading Strategies
# Note: The strategy modules referenced below are research notebooks # and not standalone importable modules. Refer to the actual notebook files: # - Simons/backend/Simons.ipynb # - Sun_Tzu/backend/Ronin_SunTzu.ipynb # For actual strategy implementation, see the notebook files directly
-
Live Trading
Open and run cells in
Live_Trading/Live_Trading.ipynb
after appropriate setup and risk assessment.
The platform supports research into multiple trading strategies:
- Simons Strategy: Quantitative trading research approach (see
Simons/backend/Simons.ipynb
) - Sun Tzu Strategy: Tactical market analysis research (see
Sun_Tzu/backend/Ronin_SunTzu.ipynb
)
Performance metrics can be analyzed through the provided research notebooks.
-
Clone the repository:
git clone [YOUR_REPOSITORY_URL] cd Prometheus
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install required dependencies:
pip install -r requirements.txt
-
Set up your Alpaca API credentials:
- Create an account at Alpaca Markets
- Generate your API keys
- Configure your credentials in the appropriate configuration files (e.g., within
Simons/Settings/
or as environment variables)
Prometheus/
βββ Assets/ # Project assets (e.g., logo)
β βββ Images/
βββ Data/ # Processed and raw market data
β βββ IEX/ # Data from IEX feed
β βββ Regular Hours/ # Data filtered for regular trading hours
β βββ SIP/ # Data from SIP feed
βββ frontend/ # Streamlit frontend application
β βββ my-streamlit-app/
β βββ Home.py # Main Streamlit app file
βββ Live_Trading/ # Notebooks and scripts for live trading
β βββ Live_Trading.ipynb
βββ Models/ # Trained models, evaluation, and related notebooks
β βββ IEX/
β βββ Regular Hours/
β βββ SIP/
β βββ Table.ipynb
βββ Simons/ # Simons trading strategy research
β βββ backend/ # Research notebooks for Simons strategy
β βββ Images/ # Images related to Simons strategy
β βββ Paper/ # Research paper published on SSRN
β βββ Report/ # Reports and results for Simons
β βββ Settings/ # Configuration for Simons strategy
βββ Sun_Tzu/ # Sun Tzu trading strategy research
β βββ backend/ # Research notebooks for Sun Tzu strategy
β βββ research/ # Research for Sun Tzu strategy
βββ .venv/ # Python virtual environment
βββ .git/ # Git version control files
βββ .gitignore # Specifies intentionally untracked files that Git should ignore
βββ CITATION.cff # Citation file for the project
βββ LICENSE # Project license (MIT)
βββ pyproject.toml # Project build configuration (PEP 518)
βββ README.md # This file
βββ requirements.txt # Project dependencies
βββ uv.lock # Lock file for uv package manager
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Alpaca Markets for providing the trading API
- Contributors and maintainers
- The open-source community
Guilherme Grancho - guilhermegrancho@tecnico.ulisboa.pt / guilherme.fernandes25@imperial.ac.uk
- Department of Earth Science and Engineering, Imperial College London
- Department of Physics, Instituto Superior TΓ©cnico, Lisbon
Vasco Pereira - vasco.serpa.pereira@tecnico.ulisboa.pt
- Department of Computer Science and Engineering, Instituto Superior TΓ©cnico, Lisbon