I am trying to save LTP information on tick, with Websockets. My intention is to perform only with curl commands, same as order placing (my Implementation in AWS, python package installation posing challenges). Checked in documentation but did not find any, can you suggest me?
@rakeshr@sujith@SRIJAN as per the documentation, variable "net_change" from trade/quote should hold "The absolute change from yesterday's close to last traded price". However i'm getting always 0. Can you check from your end?.
@Kamalv I tried rn. It's giving me the net_change correctly. To calculate %change,just do (net_change/yesterday's close)*100. For which instrument are you using quote call??
Only for indices, KiteConnect(quote) is sending net_change. And it's true,i just checked,net_change for equities and derivatives are 0 too. I tried with nifty and bank nifty when i told you that it is working. So,i thought it's working. But, websocket is showing changes perfectly.
Is there any workaround? Is there any way i can get yesterday's closing price of a stock? I can save day's closing price and refer but looking for optimized way (instead of saving all stocks closing price everyday and reading back).
@kamalv Read the documentation properly. Sujith sir told in the above thread too. The close price in the quote response is the close price of the previous day. So, you don't need to save anything. To calculate net %change just do ((ltp/close)-1)*100.
Check now. The change is 0.03%. Kite is under maintenance at night time,the prices you see are last trading day's price for few hours. If you look clearly,the ohl are also as of the last trading day i.e. Tuesday's. On Tuesday,it was 1.61% down.(You can try with the ohlc in screenshot). Midnight is not a good time to backtest today's data.
BOD(Beginning of the day) process happens every trading day around 6 AM, this is when the close field is updated. You should check post-BOD period, to get the previous day's close value.
Any alternate for updating LTP in DB.
I need change % of the stock.
I suggest you to write code for net_change. To avoid these situations.
https://kite.trade/forum/discussion/1576/change-percentage
Only for indices, KiteConnect(quote) is sending net_change. And it's true,i just checked,net_change for equities and derivatives are 0 too. I tried with nifty and bank nifty when i told you that it is working. So,i thought it's working. But, websocket is showing changes perfectly.
Is there any way i can get yesterday's closing price of a stock? I can save day's closing price and refer but looking for optimized way (instead of saving all stocks closing price everyday and reading back).
am i missing anything?