Beginner- Please help- Guide to start with Kite Connect

pavanv61
Thank you zerodha for initiating the developer forum to help newbies . And i thank all developers for helping each other.

I'm new to coding and interested to learn the automatic trading after watching the webinar. with python i can successfully initialize kite connect and place orders, modify orders etc..

But when i tried to execute the Moving average example used in webinar. I'm getting exception.

Snippet:
# Gets historical data from Kite Connect
def get_historical_data():
return kite.historical(instrument_token, from_date, to_date, interval)
kite.historical("738561", "2016-10-01", "2016-10-17", "1day")

.
.
.def start():
records = get_historical_data()
strategy(records)

start()


Exception:

Traceback (most recent call last):
File "C:\Users\pavan\Documents\Notepad++\MA.py", line 32, in
kite.historical("738561", "2016-10-01", "2016-10-17", "1day")
File "C:\Users\pavan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kiteconnect\__init__.py", line 415, in historical
"interval": interval})
File "C:\Users\pavan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kiteconnect\__init__.py", line 455, in _get
return self._request(route, "GET", params)
File "C:\Users\pavan\AppData\Local\Programs\Python\Python36-32\lib\site-packages\kiteconnect\__init__.py", line 542, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.TokenException: Invalid API credentials



Please help me to get the historical data using python with proper methods.
  • sujith
    Hi @pavanv61,
    You need to subscribe for historical data. It is add on subscription.
  • pavanv61
    pavanv61 edited January 2017
    Thanks @sujith for your response. how can i subscribe to it?

  • Kailash
    @pavanv61 Login to https://developers.kite.trade

    Open your app's page and on the right side, you can see the Historical data addon.
  • DS5593
    Hi, Referring to the Webinar :
    I have a very basic query :
    As an individual trader, Can one place orders directly from Python program without any manual intervention ?
    The reason I am asking is because I read somewhere that we need to share our strategy and get Exchange's approval before we are able to do this on fully automated basis.
  • Matti
    @DS5593 Yes, you require approvals for automated trading. Please write to talk@rainmatter.com.
Sign In or Register to comment.