Python Zerodha Multi-Account Portfolio Management Software (Jupyter Notebook)
pyPortMan is a powerful tool designed to help you manage multiple Zerodha trading accounts effortlessly. With automated GTT (Good Till Triggered) order placement and portfolio tracking, it's perfect for traders and investors looking to streamline their workflow and optimize their trading strategies across multiple accounts.
- 📈 Multi-account management for Zerodha
- 🤖 Automated GTT order placement
- 📊 Real-time portfolio tracking across all accounts
- 💹 Percentage-based allocation for each stock
- 📱 Telegram integration for instant alerts
- 🔒 Secure handling of account credentials
- 📉 Risk management through automated stop-loss and target orders
-
Clone the repository:
git clone https://github.com/hemangjoshi37a/pyPortMan.git cd pyPortMan
-
Install required dependencies:
pip install -r requirements.txt
-
Set up your Zerodha authentication:
- Open
auth_info.xlsx
- Add your Zerodha credentials for each account (User ID, Password, PIN, API Key if applicable)
- Ensure you keep this file secure and do not share it
- Open
-
Start the Jupyter Notebook:
jupyter notebook hjOpenTerminal.ipynb
-
Configure your stock list:
- Open
stocks.xlsx
- Add the stocks you want to trade, including Symbol, Percentage Allocation, Buy Price, Sell Price, and Stop Loss
- Open
-
Run all cells in
hjOpenTerminal.ipynb
-
Monitor your portfolio and GTT orders in real-time through the Jupyter Notebook interface!
-
Initial Setup:
- The software securely reads your Zerodha authentication details from
auth_info.xlsx
. - It loads your trading preferences and stock list from
stocks.xlsx
.
- The software securely reads your Zerodha authentication details from
-
GTT Placement:
- Based on your specifications, pyPortMan automatically places GTT orders for each stock across all accounts.
-
Buy-Sell Cycle:
- Initial GTT buy orders are placed at your specified prices.
- When a buy order is triggered, a corresponding sell GTT is automatically placed.
- All transactions respect the percentage allocation you've set for each stock and account.
-
Real-Time Monitoring:
- The Jupyter Notebook interface provides live updates on your portfolio status, open orders, and account balances.
In stocks.xlsx
, you can set custom percentage allocations for each stock. For example:
Symbol | Percent | Buy Price | Sell Price | Stop Loss |
---|---|---|---|---|
RELIANCE | 10 | 2000 | 2100 | 1950 |
This will allocate 10% of the available funds in each account for RELIANCE stock, with a buy order at 2000, a sell target at 2100, and a stop loss at 1950.
pyPortMan allows you to set stop-loss orders alongside your target sell orders. This helps in automating your risk management strategy across all accounts.
To set up Telegram alerts:
- Create a Telegram bot and obtain the API key
- Add your Telegram chat ID and bot API key to
config.py
- Customize alert preferences in the configuration file
- Authentication Issues: Ensure your Zerodha credentials in
auth_info.xlsx
are correct and up-to-date. - Order Placement Failures: Check your account balance and stock list for any discrepancies.
- Jupyter Notebook Errors: Make sure all required libraries are installed and up-to-date.
We welcome contributions to improve pyPortMan! Please see our Contributing Guidelines for more details on how to submit pull requests, report issues, or suggest enhancements.
This project is licensed under the MIT License - see the LICENSE file for details.
- Zerodha Kite API for providing the trading interface
- Jugaad Trader for inspiration and some code foundations
Ready to elevate your trading strategy?
If you find pyPortMan helpful for your trading activities, consider supporting the project:
Your support helps us maintain and improve pyPortMan, ensuring it remains a valuable tool for the trading community!