It looks like you're new here. If you want to get involved, click one of these buttons!
GM:daytrade godwin.monis$ ./testquotes.py asianpaintCode that gets the Date candles:
StockSymbol is ASIANPAINT
InstName is ASIANPAINT
InstToken is 60417
time,Thu Dec 22 09:26:15 IST 2016
['time', 'Thu Dec 22 09:26:15 IST 2016']
API_KEY,XXXXXXXX
['API_KEY', 'XXXXXXXXX']
REQUEST_TOKEN,XXXXXXXXXXXX
['REQUEST_TOKEN', 'XXXXXXXXXXXX']
ACCESS_TOKEN,XXXXXXX
['ACCESS_TOKEN', 'XXXXXX']
day candle start #Start prettyprint dictionary of day candle
[ { 'close': 919.05,
'date': '2017-01-09T09:15:00+0530',
'high': 933,
'low': 916.1,
'open': 932.8,
'volume': 392379}]
day candle end #End prettyprint dictionary of day candle
Traceback (most recent call last):
File "./bjstel.py", line 88, in
StockQuote=kite.quote('NSE', InstToken)
File "/usr/local/lib/python3.5/site-packages/kiteconnect/__init__.py", line 396, in quote
return self._get("market.quote", {"exchange": exchange, "tradingsymbol": tradingsymbol})
File "/usr/local/lib/python3.5/site-packages/kiteconnect/__init__.py", line 455, in _get
return self._request(route, "GET", params)
File "/usr/local/lib/python3.5/site-packages/kiteconnect/__init__.py", line 542, in _request
raise(exp(data["message"], code=r.status_code))
kiteconnect.exceptions.TokenException: Invalid token
#Get todays date
DateToday=datetime.datetime.today().strftime('%Y-%m-%d')
day1mincandles=kite.historical(InstToken, DateToday, DateToday, 'minute')
Code section that gets quote:
StockQuote=kite.quote('NSE', InstName)
*Where instname is stock symbol like 'ASIANPAINT'