Skip to content

Python wrapper for kite API to test trading strategies in live market and also deploy them.

Notifications You must be signed in to change notification settings

Cranial490/QuantWorks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QuantWorks

Python wrapper for kite API to test trading strategies in live market and also deploy them live. This framework makes it easier to communicate with Kite Connect API.
Kite Connect gives their users direct access to the Indian stock market and makes executing orders using python script in real time accessible. One of the main concern with the API is complex the login flow which we automate.

Login

kite-connect-flow

We make use of Selenium to fetch access token from kite.

  • First you need to download webdriver for your browser for Selenium. Here is the link for chrome webdriver.
  • Login process makes use of config.properties file to fetch the user details such as api_key and api_secret to access the API. You can generate your own config.properties file using the config.py. Make sure you dont share the config.properties file publicly as it contains accounts sensitive information. Give the path to the webdriver in cofig.py.
  • Now you can run setup.py which will fetch the access token and setup a kiteInstance which connects you to the API.

Backtesting

  • To start backtesting you need to fetch historical data for your intrument. For this use DataFetch.py.
  • You need to provide your config.properties path, path where you will store data and the start date and end date for historical data.
  • Run DataFetch.py along with the instrument number and you will get the csv's created with your data.
  • To start backtesting with this data you can put your strategy in backTest.py and start teting.
  • You can use methods in positionManaget.py to backtest.

Live Ticks

  • To connect with market and get live ticks for your intrument use LiveTicks.py.

Kite important links



There is a lot if work needed to be done on this framework, feel free to contribute or use as you wish

About

Python wrapper for kite API to test trading strategies in live market and also deploy them.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages