@amitchugh I am a Unix/Linux professional. Unix/Linux is the best os on the plant because it follows the following tenet "Keep it simple stupid" also abbreviated as KISS.
Putting multiple functionality under one script will lead to unnecessary comp…
@amitchugh If you read my comments you will see that I use pandas to create the candles so it's simpler to reprocess the whole ticks list and recreate all candles and overwrite the previous candle data instead of segregating the data and trying to …
@amitchugh It depends on how you are running your scripts and on what os.
I use linux and the simplest way is to run each script in a separate terminal window.
Another option is to start the scripts to run in background mode ( python myscript.py &am…
@sujith
Just a small clarification. You said rate limit is based on API_KEY.
I understand that if one creates multiple apps, each one has a different API_KEY.
Does that mean that if one has multiple apps, they will have a higher all overall cumul…
Thanks Sujith.
I generate the token and update to git which then pulls it to a remote box automatically. Worked like clockwork for months. Which is why I didnt even look there. It failed for the first time today!!
Just goes to say you can never h…
Hmm I guess this is not true. Because we do not receive all ticks. What we receive is generally an aggregate. If we were to receive full ticks then what you said would be true. But then if it was true, the bandwidth requirements would go through the…
Ok.
But aside from why or how this is happening, the very fact that I am receiving 15-20+ ticks per second is unusual right? Or would this happen under certain circumstances?
Thanks @krtrader for your kind comments. I was only trying to help.
Btw, I have done a lot more than sending 5 orders per second :-)
And this is why I avoid commenting even when I know stuff because of the incessant bullying attitude that folks hav…
Dude, there is a restriction for per second too.
Let me explain it like this:
If you start at 9:15:00 and start sending 5 orders every second, at the 39th second (count starts at 00) you will end up sending orders 196-200. You won't be able to pla…
@ZK2689 Great.
In parallel I would still suggest monitoring network connection on the side.
I caught issues with one provider and switched to another when I found that the first provider used to intermittently drop packets for a few seconds at …
@[email protected]
Since we connect to zerodha servers over the internet, it could be intermittent network errors at your end too or something as simple as dns lookup failure.
Check your dns setting and if its your ISP's DNS servers, set it to google public…
Buddy, If you expect help, you need to be a bit more specific. What do you mean by down?
Are you having login issues? Are you logged in but having issues with some api calls?
Which version of the API are you using? Which language?
Which call / modul…
@sujith: yes its working now.
What this means is that the redirect URL had a space for a couple of users. which shouldn't have been accepted in the first place. But then as a dev - been there done that myself.
I understand that you guys have been …
@sujith: One connection means 1000 instruments. And you made a comment that Zerodha plans to limit each api key to one connection only.
If someone wants to subscribe to more than 1000 instruments. This can easily happen if I track all the futures fo…
If i try either kws.close() or kws.stop or any combination thereof I get exceptions as follows:
1520571840 Fri, 09 Mar 2018 10:34:00:041181 INFO on_ticks(): Tick written to redis key batch1 and mongo collection (count:2135)
last tick: 20…
@deepaksinghvi please check the link you have posted. It's irrelevant. Therefore it would be best to remove it.
@mailboxofrafiq Check out https://github.com/mdeverdelhan/ta4j-origins Found it using a simple google search.
Check the code thoroug…
@sauravkedia ,,
script1 gets ticks from websocket. For V2 API it's a list of up to 200 stocks in each tick.
Something like :
tick = [
{"instrumentToken":1, time: 9:15:00.200, other data...},
{"instrumentToken":2, time: 9:15:00.200, other data...},
{…
@RP3436
You can in fact skip celery too. Its not needed. if you are subscribing to just 4-5 instruments, all you need is python, the kiteconnect library, redis and pandas. The efficiencies are all in the way you code. Unfortunately writing code is …
@sauravkedia : sorry for the late response to your reply on 27th feb.
First of all I do not understand why it takes you 2 seconds to load data into pandas.
Zerodha websocket library gives you a list of dictionaries. Each dictionary in the list is a…
@phantomdrake It would help if you write to log file within your app which will help you and others view what is happening with the code internally and at what stage it fails or throws exceptions. The exceptions can be logged too.
This is a sample …
Check for syntax error if you are migrating from kite 2.0 to kite 3.0
def on_ticks( ws , ticks ) : # KIte 3.0
vs
def on_tick( tick , ws ) : # Kite 2.0
And the callback assignment also changes
kws.on_ticks = on_ticks # Kite 3.0
instead of
kws.on…
@pradeepsajjan need to understand a few things about you so that folks can understand and help you better.
A bit about you and where you stand in terms of education, market experience, coding experience etc will help us evaluate your level and help …
This is a programming logic issue.
Are you placing a bracket order or or are you entering a specific stop loss order once your entry is executed? The logic would vary depending on the answer.
You could put a tag on all related orders and then write…
@archulysses I havent tried postgres. In fact I haven't used postgres for years now. However I did read up on it and it seems it supports bson and the performance is pretty good. However whether you want to use postgres or mongo would depend on your…
@vivek What does this error mean
on_close(): ERROR : 1006, connection was closed uncleanly (I dropped the WebSocket TCP connection: not enough arguments for format string)
This has been resolved. Minor issues and RTFM multiple times helped solved the issue.
It was
kws.on_ticks = on_ticks # in kiteconnect 3.0
instead of
kws.on_tick = on_tick # in kiteconnect2.0
@Ashok121: To be safe I always log in at 8:31 or later. Once I started doing that, I never had issues with invalidated access tokens.
That also means that if one wants to do any api related work, one really cant do it for the one hour window between…
Can you give a screenshot of the error? or what is the command you used?
Permission denied when installing any package typically means you are logged in as a regular user and you need to elevate user privileges by appending 'sudo' to whatever comman…
@sujith you mean migrating kite to kite3? :-)
So in simpler terms; until the migration happens although we can use kite3 for all purposes, in order to get the request token we will need to log into kite.zerodha.com. is that understanding correct…
I have tried both. Redis is obviously faster to insert and retrieve data since its in memory.
But what many people do not speak about is that redis converts the data to a utf-8 encoded str. When you read data back in from redis, you need to convert …
This is a late response. But its a bad idea to use historical api in a loop to get a bunch of instrument data. You will use up your 3 calls per second for just getting the data and will not be able to do anything else like get status / place orders …
Instead of redis, you can use mongodb since it supports native object storage and you do not need to convert pickled / str data in redis to python object or what ever programming language you use.
To speed up operations you can configure mongodb to…
NOPE!!!.
Using https://kite.trade/connect/login?v=3&api_key=xxx still redirects me to kite.zerodha.com login although I am already logged in to kite3.zerodha.com.
OK!!
I think I got it. I was trawling through the other posts and ended up with one which had a link to https://kite.trade/docs/connect/v3/user/.
So if I am not mistaken I need to call https://kite.trade/connect/login?v=3&api_key=xxx instead of…
The best way to do this is write your ticks to an in memory database like redis and then use something like python pandas to compute the candles from the tick data.
This involves some learning curve but is superfast though you will be limited by m…
Got it working. For those who would review this thread later, I present my updated code.
order_id = kite.order_place(
exchange="NSE",
tradingsymbol=InstName,
transaction_type="BUY",
…
"For example, we're able to serve a fairly large order book (~100 orders) over HTTP in under 50ms."
Does that mean that there could be an option to get more orderbook (market depth) data?