Skip to content

Repository files navigation

Algorithmic Trading Platform

A Python-based algorithmic trading platform that integrates with Zerodha for automated trading strategies. The platform provides a comprehensive set of technical indicators and backtesting capabilities.

🚀 Quick Start

  1. Clone the repository:
git clone https://github.com/yourusername/algotrading.git
cd algotrading
  1. Set up the environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
  1. Configure Zerodha credentials and trading parameters

📊 Technical Indicators

The platform includes the following technical indicators:

IndicatorDescriptionImplementation
EMAExponential Moving Averageindicators/EMA.py
MACDMoving Average Convergence Divergenceindicators/MACD.py
RSIRelative Strength Indexindicators/RSI.py
ATRAverage True Rangeindicators/ATR.py
MFIMoney Flow Indexindicators/MFI.py
SuperTrendTrend-following indicatorindicators/SuperTrend.py
VWAPVolume Weighted Average Priceindicators/VWAP.py

📁 Project Structure

algotrading/
├── data/ # Data storage and configuration
├── indicators/ # Technical analysis indicators
│ ├── ATR.py # Average True Range
│ ├── EMA.py # Exponential Moving Average
│ ├── MACD.py # Moving Average Convergence Divergence
│ ├── MFI.py # Money Flow Index
│ ├── RSI.py # Relative Strength Index
│ ├── SuperTrend.py # SuperTrend indicator
│ └── VWAP.py # Volume Weighted Average Price
├── zerodha/ # Zerodha trading integration
│ ├── backtest.py # Backtesting functionality
│ ├── setup.py # Trading setup and configuration
│ └── ema_crossover.py # EMA Crossover strategy
└── requirements.txt # Python dependencies

💻 Usage

Running a Strategy

fromzerodhaimportsetupfromindicatorsimportRSI, MACD# Initialize trading setuptrading_setup=setup.initialize()
# Example: EMA Crossover Strategyfromzerodha.strategies.ema_crossoverimportEMACrossoverstrategy=EMACrossover()
strategy.run()

Backtesting

fromzerodha.strategiesimportbacktest# Run backtest on historical databacktest.run(strategy, start_date='2023-01-01', end_date='2023-12-31')

🛠 Development

Adding New Indicators

  1. Create a new file in indicators/
  2. Follow the existing pattern:
    • Use type hints
    • Add comprehensive docstrings
    • Include error handling
  3. Add tests in tests/

Testing

pytest

📝 License

MIT License - See LICENSE for details.

⚠️ Disclaimer

This software is for educational purposes only. Use it at your own risk. The authors and contributors are not responsible for any financial losses incurred through the use of this software.

About

Algo Trading using Zerodha

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages