We just checked and it's showing correct data from {'date': datetime.datetime(2021, 11, 4, 18, 15)} to {'date': datetime.datetime(2021, 11, 4, 19, 14)} for 04th November.
Order margins is calculated per quantity. Margin is calculating the risk which only depends on the base quantity(i.e 1 here), not on the allowed trading lot(which can change or be any number). So, you can fetch margin for any quantity multiplier of …
its is reporting 2025653.7149999999 , but it should be around 25 lakhs
We just checked the basket margin for the same order and can confirm it's showing the same around 2025653(exact to be 2018230).
Can you let us know the source of this it should b…
You need to generate access_token once at the start of the trading day and re-use it throughout the day. Go through this thread to know more about access_token flush timings.
2: [ RUN ] kiteTest.profile
2: /home/shubsri93/tradeBot/cppkiteconnect-main/tests/unit/kitetest.cpp:131: Failure
2: Value of: jsonFile
2: Actual: false
2: Expected: true
Test is failing at this line of unit test. You need to check in mock_response f…
You need to check the quantity field from the fetch position. If it's negative then it is a short position else it is a long position. Quantity with zero is a closed position.
You can write a script in your comfortable language to read and download this spreadsheet into CSV. Downloadable link is:
https://docs.google.com/spreadsheets/d/1fLTsNpFJPK349RTjs0GRSXJZD-5soCUkZt9eSMTJ2m4/export?
gid=288818195&format=csv
You ca…
We just checked exchange_timestamp with the current real-time for couple of active contracts and can confirm, we don't any delay in the same.
Please paste here the debug detail regarding the delay along with the source of comparison.
last_traded_price error, retry, retry count 0
last_traded_price error, retry, retry count 1
last_traded_price error, retry, retry count 2
.....
Can you paste the error stack trace that occurred, instead of your internal debug message?
You can use Qu…
I got 504 timeout exception from Zerodha Server approximately 3 out of 5 times
Do let us know the symbol detail/instrument token?
Are you trying to fetch much older BSE historical data?
403
Means the session has expired or you are using the wrong access token. Can you re-check, if you are able to make other API call with the same access token?
COPPER21OCTFUT
You need to place order on this monthly FUT contract.
COPPEROCT21DEC21FUT
COPPEROCT21NOV21FUT
These two are spread contracts i.e spread over two months 21OCT21NOV, you can ignore these. We will remove such spread contracts from the in…
while True:
You are running a forever loop to fetch kite positions(nothing will proceed after this if a continuous exception is thrown ), which is strictly not recommended. If at all you need to re-fetch/pass(here) positions data(only after order ch…
We tried reproducing the above error of Error while fetching session. Please reload the page. at our end, on all possible publisher execution including, publisher js, dynamic button, HTML buttons. Login works fine on all of the above.
Can you provid…
instrument_dump = kite.instruments('NSE')
Yes, as @SRIJAN said. You just need to mention exchange to fetch the required exchange dump.
kite.instruments('NFO')
I am wondering whether the same can be retrieved using historical candle data for the past days
No, historical candle data will only have candles for trading hours. Eg. for equity it will be 09:15 AM to 3:30 PM.
today's close will be shown tomorrow??
Yes, it will start showing the next day from 07:30 AM onwards i.e after the BOD(beginning on the day) process.
how can i delete any comment??
Users can't delete the discussion or reply on discussion. You can me…
when I issue kiteconnect.getOHLC, its returns Close Price of previous day (as of 12-Oct-2021)
is this correct behaviour.
Yes, it's correct behaviour. You can understand more about it here.
download the instruments dump file everyday.
Not, every day but only on trading days i.e not on holidays/non-trading days as instrument dump is not updated on trading holidays .
You have heavy computation inside the threaded ticker, you need to follow the task queue method mentioned as solution1 in this thread. You can go through this example of the task queue method.
Are you trying to fetch live candles using historical data?
If yes, then historical data is meant only for backtesting not for live candle fetch. Go through this thread to know more.
Bcoz right now it is just showing an error, unlike how it re-directs while using the Kite main browser interface.
No, it won't re-direct by default to CDSL auth page. You need to add authHoldings function call, while initiating such requests.
It wi…
none of the orderbook fetch has returned the orderbook properly.
Can you please paste here the debug log for those multiple requests made for order book fetch?
We will try to dig more into this.
Yes, the default mode at Websocket subscription mode is Quote. subscribed_tokens dict maintains instrument token and modes for re-connection. So, in case of re-connection first tick received will be in Quote mode after that subscribed_tokens dict se…
{'tradable': True, 'mode': 'quote',
From your above response, subscription mode is quote. You need to subscribe to Full mode, to fetch exchange timestamp field. You can check complete tick packet structure here.
I have a command that calculates margin every 10 seconds
It's not recommended to poll funds API. You can alternatively fetch funds value at the start of the trading day and keep reducing the required order placed amount, which you can fetch from the…
For python client WebSocket, re-connection attempts starts from 2 seconds and it keeps increasing exponentially. You can go through a detailed explanation here.
@Ravina
We checked at our end, there where no order time-out issue. Can you DM your client_id?
Issue happened specifically to mentioned order_id(211007004875568), right?
We will investigate more on this.
Currently, it's not in our list. Alternatively, it's easy to maintain at your end, fetch circuit limit for list of instruments for the trading day and store them at your end.
previous days
You can use historical data API to fetch historical day candle closes.
If you want only the previous trading day close, then you can use Quote call.
We placed Sell order through Publisher JS , and got the error CDSL PIN . But while placing Sell Order CDSL Pin is not asked by Publisher JS.
Didn't get you? Is sell order from Publisher Js re-directing to the CDSL PIN page or not?
Regarding quote call it only retrieve's huge historical data at the time of the request.
No, it doesn't retrieve historical data but only a snapshot of WebSocket data at that request time. You can go through documentation here to know more.
Can i us…
We relay market data on Websocket as we receive from the exchange, the same is used for forming candles as well. It's of the post-market session. These post-market hours candles are removed post-mid-night after the chart data process.
After running the stream for more than 2-3hrs the connection error : 1006 is happening continuously and getting reconnected after a max of 5 seconds
This can only happen if there is some factor that is blocking the event loop.
As an alternative, yo…
let me know why this happened?
socket.timeout: The read operation timed out
As, the error message states, the read operation has timed out. There can various reasons for this including latency issues.
how to prevent it in future ?
You can handle a…
There is no option in zerodha kite developer page to login through 2fa, i demanded only ID and PW, is it normal,
Above 2FA TOTP is used for login to your kite account, the kite connect developer page is completely separate(it will continue to be the…
Is there any process or function where can i pass my parameters and get my request token from my code not from going to zerodha login dashboard process.
No, you need to manually login to successfully generate the request token. It's mandated by an e…
Zerodha provides a dummy apiKey for development environment
No, we don't provide sandbox environment. You will have to subscribe to Kiteconnect APIs to use the same.
October 28th(the last Thursday of the month) will be monthly expiry, not weekly expiry.
As @sujith mentions above
There is no weekly expiry instrument if it is the last week of the month since the monthly expiry
instrument is already there.
Currently, we don't have an order flow chart or order flow fields in the websocket. You will have to calculate this at your end using Websocket tick data.
Historical data while streaming at 09:15 in the morning
I guess you are using Websocket streaming here not historical data here. So, 1970 here is the epoch start time. This thread explains more.
Is there any solution to receive the ticks from the v…
But from 24/09/2021, I am not getting Nifty and BankNifty data.
Nothing changes from our side. Can you paste here the instrument token, you are using for Nifty50(Index) and Banknifty(Index)?
If you have done a proper call back for on_ticks method and subscribed to the correct instrument_token. You will at least receive one tick when connection is established. Are you getting the initial tick?