I apologize I am not a python guy. So I may be wrong. But my
suggestion is valid if above thing happened on reconnection attempt or on its first attempt to connect with websocket.
your ws.subscribe(websocket_tokens) request above lands here.
you…
Serialize the whole user object via built in
Serializer
Store it in a file. Then When required read it back via File etc.
Then
De-Serialize
and pass in the Dictionary
to User Constructor
This is to give you general idea about it and is most…
I am able to do it even without Length in advance though it would have been nice if it was provided.
On diagnosing it turns out that at least in my code
This Loop is hardly invoked..
So with EndOfMessage checking in advance one is able to mitigate…
I am very sorry I can`t help you there.
Just had a look over what is available as ready made in the market and none of it is that I would want to use myself so I cant recommend that to you. I myself always bought all parts and then assembled it my…
@SRIJAN
Hello, Do you want PC for trading purposes or are you enthusiastic about programming too.
And how below 1 Lakh. what is the max your are willing to spend.
are you trying to assemble yourself or are you buying ready-made.
Just few basic ti…
@rakeshr
Thanks for the input. Yes I know you send the length of a packet along with it.
And it would have been sufficient if that was the only packet being received.
What if there are fifty packets.
Once the packet is received I can read the indiv…
@sujith
Yaa I know it sends number of packets information! but that is not the length of those
packets upfront. then one would have to guess ( number of packets ) * ( kind of data subscribed per message length ). how does one know if all incoming…
@tahseen
Thanks for replying. I have to admit I have not worked with sockets
in C or with C itself for more than a decade, so memory about C stuff is blurry.
So it is not you who may not be understanding me, but may be me who isn`t understanding y…
Thanks for taking me to the C world!
But I am holding to C# dearly, these days.
In order to know the size in advance that information has to be somewhere reachable to the application using it.
I don`t see it anywhere, be it C# or C.
All peeks c…
for your information i am also a hobbyist programmer not professional.
kindly see this post. if it is of any relevance to you.
then we can proceed further.
i have never programmed for mobile but few things come to mind.
Freeze could be because of…
So what happened when you tried this code?
I apologize but i think async has cast a spell on you. and you are effectively bewitched by it.
by the looks of it and i could be wrong but your control will never pass ahead of
// To start the receive…
new nse site
similar info
all-reports including bhavcopy
look for Security-wise Delivery Positions (DAT) in above link. that will get you
what you want.
Thanks
Regards
@yoursvsr
returning of List rather than a single tick each time it is deciphered.
would have resulted in running a loop over that list once again to do needful by the user.
Other ways of parsing the tick binary can be implemented by the user if th…
I could be wrong here.
What might be appearing as stuck up, could actually be an error.
and your control could have moved passed too.
not the hard Exception type, but web operation related.
Try putting this operation under try{}catch( Exception e…
well by the time again with my rant.
Apart from various things that can be done about it.
when you are saying that your primary goal is to distribute the incoming tick to different terminals. That means you are trying to be just another server-node…
So let us first determine that delay is because of OnData as the subscription grows above 100. or
because of some thing else.
for that add Stopwatch here like.
Stopwatch ondataTiming = new Stopwatch();
then here
like
ondataTiming?.Restart() ;
…
Next comes an apology.
But first, was it a laptop or a 2-in-1 desktop!?.
because on daily bases i dont subscribe to more than 50 ticks. it has been long since i last
subscribed to 200 ticks. back then i never noticed any such delay.
In your above…
depends on the instruments you are subscribing to.
not all instruments are liquid or active all the time.
so you wont receive update for that until there is action relevant to the
subscribed mode, ltp, full etc.
Then comes your internet connection …
So it is a laptop.
we will come to the software part in a bit.
First let us adjust hardware:
have you enabled Turboboost / hyperthreading on it. i5-8250u has that
and set power settings of your laptop to that of High performance.
ensure using …
could you post a few lines of your code here please.
what are you doing in your OnTick
what is you computer hardware :-
RAM
Processor
Disk capacity
if you are on Window 10 right-click WindowButton then click System.
apart from what one might …
officially you do have to login manually once a day.
the information you get after login can be used through out the day,
without re-login.
As only access token is required for the websocket.
you don`t have to GenerateSession every time you open …
after
var user_credentials = kite.GenerateSession( request_token, Secret_Text.Trim() ) ;
userInfo = user_credentials ;
Store_LoginInfo( user_credentials ) ;
you can now store it however y…
i was suggesting to
download the source code of netstandard branch
add it as a project in your solution.
reference it in your coreWebApp as project reference.
instead of using nuget.
By ticket! do you mean ticker the tick data via websocket…
try using .netstandard branch directly in your project.
you seem to be using .net framework branch which are all other branches except netstandard branch.
Thanks
Regards
@themohammedfaisal
I think NSE Order limits is directed at me!
By NSE Order limits
i meant number of orders NSE can handle per second.
Wikipedia
Thanks
Regards
Well i started with websocket itself.
Therefore i am saved of Postback problem.
My major sour point is
waiting for order to complete. that really bugs me when i have placed an order and it awaits approval, and by the time price position ( trade…
I being one of those others, would want to say that
some of us don`t use Postbacks but websocket.
and there are many pain points on daily basis regarding trading, but one has just learnt to live with it.
as there are no solution to them. if the…
Yaa this is very usual affair with orders especially with early morning hours from
9:15 A.M. to 9:20 A.M.
sometimes when market is volatile.
sometimes it is RMS/OMS other-times its NSE with its order limits.
when strategy is working on very cl…
Place StopLoss Order
as your calculation for trailing the price indicates keep pushing modify order by providing the order id of the previously set stop loss order with new stop loss or trigger price.
modify order
you can track order id via
…
I am sorry if i am wrong.
But as far as knowing about websocket connection liveness.
Isn`t that already implemented via
heartbeats ( reconnection feature ).
even if no tick is incoming. kite server is sending heartbeats.
and when there is no …
Different classes can separate concerns of logic but dont automatically introduce
multi threading
or synchronicity.
and that is what you need.
From what you have written that you have made two classes. Now make
a third one and inside it let th…
from the picture you have provided they all are still comments related.
you can ignore such warnings, and worry only when your project does not compile successfully.
if you understand the implication of a warning then you can correct it yourself. or…
Kiteconnect has no external dependencies
see references
Nuget packages are for Test Project Only
KiteConnectSample project includes reference of Kiteconnect via
project reference
KiteConnectTest also does the same for referencing K…
Most of .dat files open up with simple text editors like notepad.
Others that when opened with simple text editors show binary output,
means they are using a character set ( how text has been encoded ) which is not
understandable by your text editor…
@sujith
Error parsing instrument tokens.
Isn't it generated from your side i.e kite server.
I would like to second @Gopikrishnan log. that this indeed occurs exactly as stated above.
Lost Ticker Connection
accompanies this message. I have se…
@tonystark
Missing value in format string is this intended, some kind of shortcut or a typing miss.
I dont think this can work if ever this line is called. but i could be mistaken.
It should be
throw new Exception(String.Format("Invalid variet…
Goto This NSE link
In Select Report Choose Security-wise Delivery Position.
SetDate
click Get Data.
In the downloaded CSV file you will have your information.
Thanks
Regards
you can set accesToken anywhere you want but
after you have actually gotten it.
and before you make a call to any Kite api.
call kite.SetAccessToken( MyAccessToken ) ; based on above two criterias
in the above code again you are calling kite.Se…
if this is your real code then, tell me on which line did you set the access token in kite instance.
I don`t see it anywhere and are these secret key and api key real. if so remove them immediately .
You should not post your secret information on pu…
My apologies in advance.
But it appears to me that you are not initiating Kite properly.
you say you are using C# but it appears you are trying to send direct requests via web./curl etc.
Again i could be wrong.
market.ltp is tackled by GetLTP itse…
look at line 147.
to test your invocation.
in your code above you are getting exactly what you asked for in the loop.
Item is a key in the dictionary and that is what is getting printed. you need to print values.
these keys refer to. like on line …
I am from .net world but
since Java and C# are similar being C - family languages.
C# version
Java version
might give you logical headway on PSAR
then perphaps you could translate it in java.
For C# version, since we are not using chart data…
OnTick event is a endpoint of kiteconnect library. for handing over the data to the user.
you dont call it perse but do something inside it.
pass data to a non blocking buffer
for storage
for flushing when you want to use it later …
Is their any other way to make it Com visible and use it in excel fully?
Type library export used to be best for such scenarios.
but other options are listed here
Thanks
Regards
@ak1194
in above comments @sujith mentions that.
You can only send a message for the subscription after it gets connected. So subscribe inside the onConnect.
in case you wonder why your code works even when you subscribe outside of onConnect.
T…
Hello @tonystark
Nice to hear from you after long.
Yes i can see how you are making a blocking call via .Result at line. while only in the while.
I understand all what you mentioned, but it would take time for me to figure out where i am
sliping t…
Sorry if i am wrong. but this is hilarious.
I apologize.
But you are having a couple month long problem.
because you forgot to put Console.ReadLine() or Read()
at the end of your program.
Of course your program terminates with just "Connected" mes…
Hello
Sorry if my answer appears absurd. but you can place websocket call
in C# like this.
WebSocket Call.
by first filling appropiate Uri as done here uri
then call Connect
OnTick is an event, to which you subscribe like here.
you dont hav…
@vivek and have you found a problem when the main thread was actually very fast by virtue of not getting blocked atall .
Please don`t reply it here. I dont want to highjack this thread. i am about to ask about it in my own post but found it tempt…
@sujith Zerodha has different data vendors for live ticks (websocket ticks) and historical data (chart data) Is this true?
I thought you were creating intraday candles from the same data you are passing us.
Maybe for previous days data and backward…
could it be that you are using previous version of dotnetkiteconnect
because as in your code RequestAccessToken exists no more.
GenerateSession is the function in current default library.
Why not upgrade to new version.
Thanks
Regards
Ps: I am so…
yes that is exactly the cause. it is after market hours.
during market hours you will receive ticks as the change happens in the data of the
prescribed scrips. i.e change in LTP, etc...
Thanks
Regards
@sujith
actually it would be very good if exchange was to provide Sell volume and Buy volume. based on how the trade was initiated. that is, was the order placed as sell order initially and somebody came and bought it. or was the order placed as bu…
on_ticks is a callback. Kite server is throwing tick data to this function. you have to do nothing just listen to it from inside of it. just don't do anything while listening that would take time and block this function. pass the ticks received here…
@ZK2689
I have not dealt with such issues yet with PlaceOrder. Your PlaceOrder call will ultimately boil down to
Request. function.
now let us see where you might have got stuck!.
this is where actual network call happens
code there seems to b…
where exactly are you looking these.
Did you download instruments list?
in kite instrument list this is available.
instrument exchange trading
token token symbol
-------------------------------------------------
2…
@vivek Thanks for the response.
already fixed it on my side.
Would you kindly explain my 3rd point in 1st question. I am curious!.
As you can see in my second comment, 2 response strings have query parameters at completely different locations/ind…
okay So now here is another response
Previously
https://kite.trade/?request_token=28zcRP0wg80bQxqAfRD3OP2J9iv32uok&action=login&status=success
Now
https://kite.trade/?action=login&status=success&request_token=QAWOAzBo9CuS8S4Ms58…
I apologise for sounding stupid or out of place, but until it is resolved/understood for you, why don't you experiment with
pnb lowpriceBand
pnb upperpriceBand
(+-) adjusted to what might be the future price at that point of time.
There must …
@Nikhil.A Thanks for the response.
I know about this stuff. I don't know why it never crossed my mind.
All this while I was thinking somebody put a stoploss order
on the wrong side and somebody got lucky with that.
This tick skip thing is scarry! …
In BANKNIFTY future chart which is 2nd chart below NIFTYFUTURE chart every time a new high is made it is because buy/sell price depth has moved to that price also.
whereas In NIFTYFUTURE chart, when new HIGH was reached, it did not coincide with c…
I don't think web socket is time-centric. it is change in price/trade-centric have you tried full mode.
what do you mean by actual trades?
if you mean last five trade prices instead of buy/sell Price depths. I don't think that is provided by any ve…
what is fake on-ticks (function). is this something unique to python client.
if you mean you want only the ticks from 9:15:00 A.M onwards till 3:29:59 P.M.
for that you will have put a filter at your end by comparing the Timestamp in the received t…
Sure you can.. currently in four ways. until we have sandbox provided.
1. Just make sure you are testing your strategy on holidays. that way all your orders would be rejected. and cause you no financial harm.
2. On trading days. Make sure the…
@Jegan I am also skipping placing orders today.
@MadanGoyal yaa my app also relies on previously stored instrument list in case something goes wrong.
Thanks
Regards
@jegan if you can download the source from Clone or download
you can change the line as mentioned in above post. recompile, and reference .dll in your solution.
as a temporary solution to this problem.
Thanks
Regards
I would like to second that but want to include the list of instruments that are causing this
6656001
6659841
6658305
6660353
6659073
6659585
6665985
6659329
6658049
all of these cause exception of the exact message shown below
obviously …
I also provisioned for SBI see if it matches your data I don't see quote in mine. Change .pdf to .zip and unzip it. You will find files with minute timestamps precisioned to milliseconds i.e all ticks for one minute are stored in one file.
public …
I did try as you said, only the first tick for 15600898 announced itself as quote and then it became full for the rest of the streaming as was requested. perhaps it is less volatile/liquid. Indices also I placed in full mode. although it does n…
@RP7220
256265 NIFTY NIFTY 50
260105 BANKNIFTY NIFTY BANK
As these scripts does have depth, so i am getting the quotes for these.
did you mean to say does not have depth instead of does have depth
I checked above two in full mode. it returns allr…
@sujith One need not set mode in OnConnect. I do the same as above and am receiving ticks allright. Unless something turns out to be wrong on investigating the stored ticks. since I am not using them actively yet. but from the looks of it
15600898…
Infos regarding stocks
You can see date of listing in All EQUITIES link.
DEBT
http://www.nseindia.com/content/equities/DEBT.csv
Delisted
http://www.nseindia.com/content/equities…
I would like to access the tradebook of my account using APIs. Is it possible?1. It is for current days trade Click here for Api
2. Publisher intro
3. publisher- js-plugin
Yes for personal api use, you need connect account or you can get …
Questions
Answers
i am requesting the quote to
refresh on every new page request (1/sec).
I dont think this would result in rate - limit
i am only trying to process one order.
i am not supposed to send an ord…
error 429
describes it as rate-limiting. are you crossing the current limit of 5 orders per second. check limits.
if so, you will have to pass your orders through a scheduler at your end that wont let fire more than the prescribed number of orders …
Did you already convert it? if not then below are the api`s.
If you did ignore the below apis.
On successful conversion is it not reflected in GetPositions?
For .Net
For Java
For Python
For Php
For Java Script
Thanks
Regards
why don`t you make extra variables. which inform if first order has been placed or not and only then check for positions i.e if your trade is MIS instead of CNC.
i don`t remember VBA syntax but logically:
if ( firstOrderPlaced == true ) then
…
request token is received during login and used to generateSession. what is received as a result of generating session contains a refreshToken which might be used in future to refresh session that will give new access token
Thanks
Regards
in PlaceOrder Tag is already an argument provided, you just have to fill it and crosscheck it with the order details you download, or receive through websocket connection.
Length of Tag word cannot be more then 8 characters.
Thanks
Regards
Apart from the python stuff ; You are missing only on one point. you are not storing the userinfo aquired from GenerateSession external to your scripting enviornment. so that it can be retrieved when you start again. you don't have to go through all…