Issues with KiteXL

Ones
I am facing following issues:

1) Getting Blank Cell when calling GetOrderStatus with Order Id. It does not show, open, cancelled, rejected etc, it just shows black cell, while the GetOrderStatus formula appears in the formula bar of the blank cell.
2) "Too many Request" Error, on calling Order Book from KiteXL, while there are not more than a dozen orders placed in a day. Even though I have subscribed to only 5 scrips. Also occasionally getting the same error while placing order from excel.
3) Nifty spot does not show live values it only shows last days closing, using GetRTD ("NSE","Nifty 50"). How to get live Nifty Spot values in a cell. The open, low, high, close cells returns zero value.
4) Bandwidth consumption in a trading day from 9:15 to 3:30 is around 2 GB even though I have only subscribed quotes for only 5 scrips. Is this normal or is KiteXL downloading something more, which I don't know.
5) Modification of open orders returns error of "OrderType Type is Null or Invalid"

  • haribabu
    Too many requests is the most common error I too get, not resolved till date even after release of Kite Version 3.0
  • Ones
    Ones edited September 2017
    @haribabu
    Building a stable system is out of scope if this is a regular error and there is no resolution or work around for this. I understand that the API is designed to process 3 requests/ sec. and hence this error this thrown, but I could not understand that even when my activity is extremely negligible still why this error? What all constitutes 3 "Requests" in one second?

    Any feedback/views on other queries mentioned above.
  • sujith
    Hi @haribabu, @Ones,
    All HTTP requests are limited to 3 requests per second. It's not actually an error, it's just system flagging status code 429 ''too many requests".
  • Ones
    Ones edited September 2017
    @sujith

    But even for placing around say 10 - 12 order in a day, how could system flag it down. I mean even during the testing phase of placing order or modifying it by manual punching the keys in the cell too throws this error.

    Just for example, even clicking the Order Book button on KiteXL file, the Orderbook sheet page returns "Too many Requests". Now isn't it just ONE request made by clicking the button and calling the GetOrderBook function.

  • Ones
    @sujith
    Also if you could address other points mentioned my first post. Thnks
  • sujith
    @Ones,
    I think manual punching won't cause this. There must be something else.
    KiteXL is built by @botany02, maybe he can help you with this.
  • Ones
    Ones edited September 2017
    Point 3) is resolved, now getting spot quotes for Indices.
  • botany02
    @Ones @haribabu
    Point 1,2 & 5 may be caused due to KiteXL.
    After you placed a order, KiteXL will check for the order status at an interval of 10sec till the status changes to complete,cancelled or rejected.When you place more order, more loops are created and causing 'To Many Request' Error.Since the order status is not returned, the GetOrderStatus will return default empty string.

    Regarding point 4, 2Gb of data is something big, KiteXL will not consume this much data.You need to check which app is consuming this much data.

    We will be replacing the KiteXL with new one which will solve all the issues at once and have increased performance.Better wait till the new one is out.
  • Ones
    Ones edited September 2017
    @botany02
    1) Rechecked again, the data consumption is over 1.5 GB for 10 subscribed scrips from 9:00 to 3:30. There are no other apps, running. The machine is exclusively for trading.
    What is the benchmark normal consumption in a trading day. Is the data usage dependent on scrips subscription or independent?

    2) When is the new KiteXL coming out? Any tentative timeframe?
  • Ones
    Ones edited September 2017
    @botany02
    KiteXL logs out very often, especially when there any macro returns error or is interrupted. So before placing any order or modification, each time I need to check the log in status, is there any way to avoid this problem of auto log out or any way to auto login again in case of interim log outs durignt
  • sujith
    @Ones,
    Make sure you are not logging into any of our platforms Pi or NEST. If you log into these platforms then you will be logged out. For monitoring purpose use Kite. Kite will use the existing session after successful login.
    If you log out of Kite then you are logged out everywhere.
  • botany02
    @Ones
    If you edit vba or some macros throws error, all the variables are re-initialized, that's the default behavior of VBA. To avoid this ensure that all Methods/Functions/Macros are having error handler.

    New KiteXL will be out in mid of October.
  • Ones
    Ones edited September 2017
    @botany02 , @sujith
    To get order status, in terms of QTY filled (for Limit Orders), the only way I could find is to Call GetOrderBook function. Is this intentional or by design? Cant this be fetched through Websockets? Or is this addressed in the new KiteXL? Or if you could create some function to getting pending or filled qty details from OrderId, this will be best served. Since then you will not need to call OrderBook but only specific OrderId.

    Even Calling GetOrderStatus returns the status viz OPEN, but does not contain any details of filled or pending qty. Similarly the GetOrderDetails is pretty useless, since it serves no purpose than an post facto details of the Order, without any meaningful usage.

    Calling GetOrderBook takes time and runs into few seconds and this depends on the number of orders in the orderbook. So if there are many orders (including Rejected, Cancelled, Open and Complete), the response from this function runs into several seconds. Is there anyway of fetching order status (mainly Filled and Pending QTY for Limit Orders). This is very important since sending modification of open orders (partially or fully unfilled) depends on getting inputs from the Order Book status. And this delays the entire process of executing a straight forward Limit Order.
  • botany02
    @Ones
    Current version of KiteXL is very very limited due to the below factor.

    At present, we do not get auto order update from kite server via web-socket(This will soon available as per official note), once we receive order update via web-sockets, every issue will be resolved.

    You will get plenty of options to get order details without making any GET request thus increasing performance.

    Every issue will be addressed in the new KiteXL.
  • Ones
    @botany02
    Thanks for the update.
    Just one last query. As mentioned earlier, the data usage is pretty substantial. Could you tell how much is fair usage in a day. Also is it dependent on subscribed scrips or irrespective of subscription.

  • botany02
    botany02 edited September 2017
    @Ones
    Below is just theoretical calculation.
    For streaming through web-sockets

    In Full Mode, 164 bytes/sec/scrip(Assume Liquid scrip)
    Appx for 6.5 hrs of trading

    6.5*60*60 = 23400 sec
    23400 *164 = 3837600 bytes/scrip = 3.84 MB/scrip

    Appx for whole trading day, one scrip may consume 5 MB max for streaming.
  • Ones
    Ones edited October 2017
    @botany02 ,
    I realised that the streaming data continues i.e. subscribe quote is functioning even while the account is not logged on i.e. you get logged out (post logging in first) for any reason. Like you keep on receiving streaming data but cant place the order as you get error "user not logged on", if you try to place order.
    Since the streaming data continues despite you automatically get logged out for whatever reason, how does on know whether he is logged on in his trading account and order placement can be done without any hinderance. Is there any function to continually check the logged in status.
  • botany02
    @Ones
    That's the default behavior of Kite Connect API, you will continuously get data in websocket even you logged-out.

    There is no API to check login status.You will to come to know only when error is thrown while placing order or get order book/positions.You may request this feature to Zerodha.

    The only workaround is, while working with Kite API (KiteXL in this case)
    You should login to Pi/Nest Trader
    You may login to https://kite.zerodha.com but should not logout just close the browser or tab.

    If you logout in one platform, then you will be logged-out from everywhere including Kite API.
  • Ones
    Ones edited October 2017
    @botany02
    Ok. Thanx.
    I am looking for a workaround where I need streaming quotes to stop the moment the account gets logged out, for any reason viz, internet disruption, or logging out by self or some technical glitch from the server etc etc. For this can calling the UnsubscribeQuotes function work, while the account is already logged out. I mean though the streaming quotes keep coming despite being logged out, will it be possible to stop the quotes by sending unsubscribeQuotes function after getting logged out.

    My requirement is to immediately stop streaming quotes once the account is logged out (accidently or intentionally) during the market hours.
  • botany02
    @Ones
    UnsubscribeQuotes will work even if your account is logged out.
    But the issue is , there is no event that will trigger when your account is logged-out.

    You will only come to know when error is thrown while calling order functions.
  • Ones
    @botany02
    I agree that is a real pain in the wrong place, hence 2k a month is a big price to pay for this "conditional" automation, even while the closest competing discount broker is charging just 750 bucks for the same thing.

    Btw, I tried calling the UnsubscribeQuotes while the account was logged out but it returned "User not logged in" so I guess the quotes will still keep streaming in and wont stop. I checked this post market hours so am not sure whether UnsubscribeQuotes returning User Not logged in will actually stop the streaming or not.

  • Ones
    Ones edited October 2017
    @botany02
    Facing a new login issue. During logout during the trading day, earlier when trying to relogin, the account details were not asked, I mean post logging in the account for the first time in the day, the account login details, 2 questions etc are asked but then during the subsequent relogin during the day, only the Login page is displayed and after a few seconds the account is automatically logged in.

    But now, even during relogins done on multiple occasions during the day (due to disconnections or interuptions) while calling the Login function, the login page appears and all details of account, passwords, 2 questions etc have to be submitted again. This was not the case earlier. So sometimes it is asking for all details and sometimes it is not asking and proceeding for automatic login with the credentials keyed in at the start of the day. Why is such thing happening. It will be fine, if all the time only one thing is asked, either auto login with account and passwords details fed in the morning or all the time ask for all details. What could be the issue here for giving two types of logins output during relogin during the day.
  • botany02
    @Ones
    It's not controlled by KiteXL instead by kite.zerodha.com

    Kite Server stores cookies in user computer which has details of your successful login, sessions etc.
    Whenever you open kite.zerodha.com from any web browser, first it checks for the cookies and reads the data stored in it, if it finds client has successfully logged-in earlier, it just go to next page else goes to login page.If you press log-out button in kite.zerodha.com or close the browser, cookies related to login are deleted and you are forced to login.

    Some cookies are having high validity like gmail where you no need to login every until you sign-out.

    I suspect, some issues with cookies stored.
  • Ones
    Ok Thanks.
This discussion has been closed.