This repo contains sample templates for implementing strategies in python.
I have used Zerodha's kiteconnect api for developing sample strategies.
Here are some important links that you may need to go through to understand the login and other related stuff.
- KiteConnect API Doc
- KiteConnect Python Doc
- KiteConnect github page
- KiteConnect developer login
- KiteConnect developer forum
pip install -r requirements.txt
pip install selenium
- Download the correct webdriver from here and place the .exe file in the directory having
access_token.py
- Create api_key.txt file with the following info -
- API KEY - Obtained from the trading app in your developer account.
- API SECRET - Obtained from the trading app in your developer account.
- USER ID - Zerodha Kite user id.
- PASSWORD - Zerodha Kite password.
- PIN - Zerodha Kite pin.
Buy when PSAR crosses below candle and sell when PSAR crosses above candle.
The code for the same is in strategy_PSAR.py
and other utility functions are in utils.py
It is recommended to change the global variables in strategy_PSAR.py
as per the new startegy. Also run the strategy_PSAR.py
a minute later than candle start( if working with larger duration candles like 15minutes or bigger). For ex. if you want to start at 9:15 AM run the code at 9:16 AM to avoid some signals being missed.
- run
python access_token.py
- run
strategy_PSAR.py