The Repeated-Median-Velocity-Trading-Strategy is a quantitative trading strategy that utilizes the Alpaca Stock API to fetch market data and implements a repeated median velocity trading indicator. This project employs walk-forward optimization to identify optimal system parameters for intraday trading. The strategy is inspired by the research paper: The Robust Repeated Median Velocity System by Dennis Meyers.
The Repeated-Median Velocity is designed to capture trends efficiently while minimizing effects from outlier data by using a robust statistical method known as the repeated median regression (Siegel Slope).
This project provides a systematic approach to developing, backtesting, and optimizing trading strategies using vectorbt and the Alpaca API with Python.
- Repeated Median Velocity Indicator: Implements the repeated median method
- Walk-Forward Optimization: Utilizes vectorbt walk-forward optimization techniques to determine the best strategy parameters for each trading week.
- Alpaca Stock API Integration: Fetches historical data from the Alpaca API (can be extended for real-time data).
- Intraday Trading Focus: Constructed for executing trades within a single trading day.
- Robust Backtesting: Uses vecortbt's tools to test strategy performance against historical data and highlight trading metrics.
To get started with the Repeated-Median-Velocity-Trading-Strategy, follow these steps:
- Python with libraries found in
requirements.txt
- Alpaca account with API key and secret
git clone https://github.com/0zean/Repeated-Median-Velocity-Trading-Strategy.git
cd Repeated-Median-Velocity-Trading-Strategy
pip install -r requiremnts.txt