☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
153
Node JS client
40
Go client
793
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
993
Java client
1.1K
API clients
404
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
cannot get margin.
sanket_one
May 2020
in
Python client
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:
https://api.kite.trade:443
"GET /user/margins HTTP/1.1" 200 None
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): api.kite.trade:443
DEBUG:urllib3.connectionpool:
https://api.kite.trade:443
"GET /quote/ohlc?i=NSE%3AAMARAJABAT HTTP/1.1" 200 None
for_ltp {'NSE:AMARAJABAT': {'instrument_token': 25601, 'last_price': 615.25, 'ohlc': {'open': 612.4, 'high': 623.95, 'low': 603, 'close': 614.4}}}
ltp 615.25
ERROR:kiteconnect.ticker:Connection error: 1006 - connection was closed uncleanly (None)
inside theeeee error block
connection was closed uncleanly (None)
ERROR:kiteconnect.ticker:Connection closed: 1006 - connection was closed uncleanly (None)
############################
i was trying to fetch my margin before placing order.
def buy(name):
account = kite.margins()
balance = account['equity']['available']['live_balance']
name_of_ohlc = "NSE:"+name
for_ltp = kite.ohlc(name_of_ohlc)
ltp = for_ltp[name_of_ohlc]['last_price']
#buy
def ohlc_maker():
#code
buy(name)
def on_ticks():
ohlc_maker()
can someone help me. i am new to python and concept of threading, according to one post i tried to not do calculations in on_ticks(). is there anything more i need to do?
Tagged:
WebSocket
kiteconnect
orders call
Sign In
or
Register
to comment.