A simple kill switch for a kite to prevent overtrading.
This project is a simple kill switch for a kite. It is designed to stop overtrading. The kill switch will check if you have any open positions and if the total loss is above a specified threshold. If the loss is above the threshold, the kill switch will close all positions, cancel all orders, and activate the kill switch. The kill switch will wait for a specified time before checking again. This project is designed to prevent overtrading and protect your capital.
- Python 3.8
- kiteconnect
- pandas
- json
- time
- datetime
- os
- sys
- logging
- selenium
- Clone the repository
- Add
position_kill_switch.py
to your task scheduler or crontab.
A template configuration file (credentials_template.json
) is provided in the repository. You can copy the template and rename it to credentials.json
. Then you can modify the configuration file to suit your needs.
You need to have the necessary API credentials to run the script. You can get the API credentials from the Kite Connect.
TOTP must be enabled in your Kite account for this project to work.
Please ensure that you have the necessary API credentials in the
credentials.json
file before running the script. Without the correct credentials, the script will not be able to access the necessary data and perform the required actions.
- Run
position_kill_switch.py
. - The script will check if you have any open positions.
- Then the script will check if the total loss is above threshold.
- If the loss is above threshold, the script will close positions, cancel all orders and activate the kill switch.
- The script will wait for a specified time before checking again.
- You can also directly run the
kill_switch.py
script to manually activate the kill switch. - This script will skip the checks and wont cancel orders or close positions, but directly activate the kill switch.
Hi, I'm Pranav Meher
, the author of this project.
I am a skilled software developer with a strong background in algorithmic trading. I have a deep understanding of the financial markets and have successfully implemented numerous trading strategies. I am passionate about creating reliable solutions to prevent overtrading and am dedicated to continuously improving this kill switch project. I welcome feedback and contributions from the community.
You can connect with me or reach out to me to learn more about my work and stay updated on the latest developments.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details.