Hi, I want to convert websocket data to candlesticks but values are not matching.
Wanted to understand should I use “last_traded_time” or “exch_feed_time” to convert to 5 mins candlestick patterns.
Also, it would be very helpful if you could provide code/scripts that fyers uses. Thanks
Hi Akash Kumar,
Could you please confirm which values are not matching?
- Last_traded_time: The time when the last trade occurred.
- Exch_feed_time: The time when the exchange feed was last updated.
Based on your use case, you can choose to refer to either Last_traded_time or Exch_feed_time.
In most cases, both will be the same. However, for symbols with low trading activity, these times may differ.
For matching with candle timeframes, you can referExch_feed_time.
*Could you please confirm which values are not matching?
*When I am converting websocket data to 5 min candle stick patterns, my candlestick values are different from fyers web. Ideally the values I calculate should be same as shown on fyers web.
Obviously I’m assuming there is a mistake from my side and I want to narrow it down
My usecase is I want to build candlesticks from websocket data that will match with fyers web data.
I will move ahead with “Exch_feed_time” pattern and narrow down the issue.
Thanks for the prompt response.
Hi @naresh_janagama ,
I observed some serious difference between the websocket data and fyers web data.
1. Close Price is not matching
For eg: close price of tcs of JUNE 18
fyers web: 3455
Websocket shows : 3451.4
{‘ltp’: 3424.7, ‘vol_traded_today’: 131028, ‘last_traded_time’: 1750305069, ‘exch_feed_time’: 1750305069, ‘bid_size’: 36, ‘ask_size’: 16, ‘bid_price’: 3424.0, ‘ask_price’: 3424.7, ‘last_traded_qty’: 1, ‘tot_buy_qty’: 74863, ‘tot_sell_qty’: 94025, ‘avg_trade_price’: 3434.32, ‘low_price’: 3421.0, ‘high_price’: 3451.0, ‘lower_ckt’: 0, ‘upper_ckt’: 0, ‘open_price’: 3450.0, ‘prev_close_price’: 3451.4, ‘type’: ‘sf’, ‘symbol’: ‘NSE:TCS-EQ’, ‘ch’: -26.7, ‘chp’: -0.7736}
Axis bank for same date:
fyers web: 1220
Websocket: 1221
{‘ltp’: 1220.2, ‘vol_traded_today’: 115126, ‘last_traded_time’: 1750305069, ‘exch_feed_time’: 1750305070, ‘bid_size’: 8, ‘ask_size’: 101, ‘bid_price’: 1220.0, ‘ask_price’: 1220.2, ‘last_traded_qty’: 99, ‘tot_buy_qty’: 198787, ‘tot_sell_qty’: 214317, ‘avg_trade_price’: 1220.21, ‘low_price’: 1217.0, ‘high_price’: 1225.0, ‘lower_ckt’: 0, ‘upper_ckt’: 0, ‘open_price’: 1218.0, ‘prev_close_price’: 1221.0, ‘type’: ‘sf’, ‘symbol’: ‘NSE:AXISBANK-EQ’, ‘ch’: -0.8, ‘chp’: -0.0655}
- Close Price is not matching
Did not recieve a price, for eg:
for eg: for timestamp 2025-06-19 09:20:00, fyers web shows low price as 3421.0 but I did not recieve any json response that have ltp of 3421 between 2025-06-19 09:20:00 to 2025-06-19 09:25:00, lowest I got is 3421.7 at exch_feed_time of 1750305016.
CAn you tell me what can be the issue? I am subscribing to all the symbols that supports 5x leverage by fyers
https://fyers.in/calculator/margin/equity-margin/
Hi @naresh_janagama can you please look into this?