Welcome to the Quantitative Trading Strategies repository! This collection features a variety of Python-based trading strategies for analyzing financial markets. Each strategy is accompanied by thorough documentation and organized code, allowing for easy understanding, customization, and implementation.
- Overview
- Getting Started
- Directory Structure
- Usage
- Strategies
- ML Prediction Models
- Options Strategies
- Backtesting
- Results
- Dependencies
- Contributing
- License
- Acknowledgments
- This repository aims to explore and implement quantitative trading strategies for financial markets.
- Strategies are designed to leverage historical market data to make informed trading decisions.
- Implemented in Python, the code is well-structured and documented for users to easily comprehend and adapt.
-
To get started, clone this repository to your local machine.
git clone https://github.com/AnujRaskatla/Quant-Trade-Strategies.git
-
Install dependencies by running
pip install -r requirements.txt. -
Follow the instructions in the README files of individual strategy directories.
- data/: Contains sample datasets and instructions on obtaining market data.
- strategies/: Each subdirectory represents a different trading strategy.
- backtesting/: Includes scripts for evaluating strategy performance.
- Replace
your_data.csvin the script with the actual file path or URL of your historical stock price data. - The data should contain at least the following columns:
Date: Date of the stock price data.
Open, High, Low, Close: Stock price details.
Volume: Trading volume.
Ensure that the 'Date' column is in datetime format. If not, convert it using pd.to_datetime().
- Run the script:
your_strategy_script.py - View the model evaluation results and visualization in the console and generated plot.
-
MeanReversion/: Implements a mean-reversion trading strategy.
README.md: Detailed explanation of the strategy, parameters, and logic.mean_reversion.py: Python script containing the strategy code.
-
TrendFollowing/: Implements a trend-following trading strategy.
README.md: Comprehensive overview of the strategy.trend_following.py: Python script for the strategy.
-
SMA (Simple Moving Average): based on SMA crossovers, aiming to generate buy and sell signals.
- README.md: Comprehensive overview of the strategy.
- sma_script.py: Python script containing the strategy.
-
Pair Trading/: based on z-score, aiming to generate buy and sell signals after threshold.
-
MACD x RSI/: Used indicators - MACD and RSI to generate buy and sell signals.
- Random Forest Regressor Strategy/: utilizes a Random Forest Regressor to predict stock prices based on historical data
- README.md: Comprehensive overview of the strategy.
- ML_script.py: Python script containing the strategy.
- Covered Call Strategy/: involves owning shares of a particular stock and selling call options against those shares.
- README.md: Comprehensive overview of the strategy.
- CC_script.py: Python script containing the strategy.
- The backtesting/ directory contains scripts for evaluating the performance of each strategy.
- Detailed instructions on running backtests are provided in the README.md.
- Visualizations and performance metrics for each strategy are available in this section.
- Backtest results demonstrate the effectiveness of the implemented strategies.
- Key dependencies include pandas, numpy, and matplotlib.
pip install pandas numpy matplotlib- View the
requirements.txtfile for a complete list with version information.
- Contributions are welcome! Please follow the guidelines outlined in the CONTRIBUTING.md file.
- Submit issues, feature requests, or pull requests to contribute to the project's development.
- This project is licensed under the MIT License. See the LICENSE.md file for details.
- Gratitude to the open-source community and contributors.
- Acknowledgments to external libraries and data sources used in the project.