This project implements an automated options trading bot that uses a modified version of Tom DeMark's TD Sequential strategy. The bot interfaces with the Shoonya broker platform to execute trades automatically in the Indian markets, specifically focusing on NIFTY options.
- Real-time market data processing using Fyers API
- Three distinct trading strategies based on TD Sequential:
- TD Support & Resistance (TDSR)
- TD Breakout (TDBO)
- TD Reversal (TDR)
- Automated options contract selection
- Dynamic stop-loss and target management
- Break-even protection mechanism
- Risk management with adjustable parameters
- Comprehensive logging system
- Python 3.x
- Fyers API v3 for market data
- Shoonya API for order execution
- Pandas for data manipulation
- Custom technical analysis modules
The project is structured around the TradingStrategy class which manages:
- Market data processing
- Strategy execution
- Order management
- Position tracking
- Risk management
- TD Setup: Base TD Sequential calculations
- TD Breakout: Breakout detection and signal generation
- TD Reversal: Reversal pattern identification
- TD Support/Resistance: Dynamic level calculation
- Order Management: Integration with Shoonya broker
- Risk Management: Stop-loss and position sizing
self.MULTIPLAYER = 0.8 # Risk multiplier
self.RISK_TO_REWARD = 10 # Risk:Reward ratio
self.BREAK_EVEN_POINT = 0.3 # Break-even trigger point
self.LOT_SIZE = 25 # Standard lot size
self.MAX_LOSS_CAP = 10 # Maximum loss limit- Dynamic strike price selection
- Automatic stop-loss adjustment
- Break-even protection
- Target booking
- Position tracking
- ATR-based stop-loss calculation
- Maximum loss caps
- Break-even triggers
- Multiple take-profit levels
- Position sizing rules
- Real-time data processing
- Multiple timeframe analysis
- Support/Resistance identification
- Trend direction confirmation
- Volume analysis
- Clone the repository
git clone https://github.com/HarshalNerpagar/AlgoTradingBot_Python.git
cd AlgoTradingBot_Python
- Install dependencies
pip install -r requirements.txt- Configure API credentials
# Add Your access token here
cd access_token- Set up your broker credentials in the configuration file
- Adjust risk parameters if needed
- Run the main script:
python main.py- Identifies key support and resistance levels using TD Sequential
- Generates trade signals on level breaks
- Incorporates momentum confirmation
- Detects breakout patterns in price action
- Uses volume confirmation
- Implements time-based filters
- Identifies potential reversal points
- Uses TD Sequential setup counts
- Incorporates price action confirmation
- Automatic session disconnection at market close
- Error handling and reconnection logic
- Position verification system
- Order execution confirmation
- Risk limit enforcement
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This software is for educational purposes only. Use at your own risk. The author and contributors are not responsible for any financial losses incurred through the use of this software.
For internship inquiries or questions about the project, please reach out through: