Response of websocket

Hi team,

I was working with the WebSocket and had a few queries. They are as below:

  • The average trade price (ATP) does not have a decimal point. Does it always have 2 decimal values at the end? If that’s the case, we can just divide the response ATP by 100 to get the actual ATP.
    My suggestion is that ‘avg_trade_price’ can be replaced by ‘atp’

  • My suggestion is that ‘last_traded_time’ can be replaced by ‘ltt’

  • You can do this for all parameters where it can be done.

  • This way the response will be smaller and crisper.

  • What are these parameters that start with ‘min_’?

  • In the ‘market_pic’, the 1st five correspond to buy and the next five to sell, right? Just for clarification.

@vikram_sri please shed some light on this.

Hello Vishnu,

I am also working on the Fyers websocket connectivity. Do you mind sharing the code snippet you used to establish the websocket connectivity.

I am getting an error while connecting:

{‘s’: ‘error’, ‘code’: -209, ‘message’: ‘Please provide the validation parameter’}

  • Prices which are shown are on the basis of calculations so if the atp is shown in decimal that is shown after the final calculation and dividing it by 100 will not give the correct price. I have forwarded your suggestions.
  • min stands for minute.
  • Yes you are right, In the ‘market_pic’, the first five correspond to buy and the next five to sell.

Thanks for the clarification. I just have doubt regarding the ATP. In the picture, if you see, the ATP is given as 9299. How can I use this data? The actual ATP is 92.99 I think. That’s why I was asking if I need to divide by 100. Let me know if you need more clarity on the question.

@vikram_sri Please provide clarification to my follow-up comment.

Vishnu let me know if the output of the ATP is coming properly, because the ATP value should be calculated and provided properly, I’ll be forwarding this to the team.

Custom [{‘symbol’: ‘MCX:SILVERMIC21AUGFUT’, ‘timestamp’: 1626361131, ‘fyCode’: 7208, ‘fyFlag’: 2, ‘pktLen’: 200, ‘ltp’: 69675.0, ‘open_price’: 69540.0, ‘high_price’: 69970.0, ‘low_price’: 69540.0, ‘close_price’: 69560.0, ‘min_open_price’: 69665.0, ‘min_high_price’: 69675.0, ‘min_low_price’: 69655.0, ‘min_close_price’: 69675.0, ‘min_volume’: 66, ‘last_traded_qty’: 1, ‘last_traded_time’: 1626361129, ‘avg_trade_price’: 6974318, ‘vol_traded_today’: 76445, ‘tot_buy_qty’: 10731, ‘tot_sell_qty’: 12329, ‘market_pic’: [{‘price’: 69667.0, ‘qty’: 1, ‘num_orders’: 1}, {‘price’: 69666.0, ‘qty’: 4, ‘num_orders’: 1}, {‘price’: 69665.0, ‘qty’: 8, ‘num_orders’: 4}, {‘price’: 69664.0, ‘qty’: 22, ‘num_orders’: 3}, {‘price’: 69663.0, ‘qty’: 4, ‘num_orders’: 1}, {‘price’: 69675.0, ‘qty’: 17, ‘num_orders’: 4}, {‘price’: 69680.0, ‘qty’: 15, ‘num_orders’: 6}, {‘price’: 69682.0, ‘qty’: 1, ‘num_orders’: 1}, {‘price’: 69684.0, ‘qty’: 1, ‘num_orders’: 1}, {‘price’: 69685.0, ‘qty’: 1, ‘num_orders’: 1}]}]

@vikram_sri Please see in the above response ATP highlighted. I believe the ATP should’ve been 69743.18 and not 6974318.

I am also getting the same error.

Sir, please guide me on the “volume” value. Which value should be considered for the value of volume for a minute candle ?

  • Is the sum of tot_buy_qty and tot_sell_qty?
  • Or min_volume?
  • If I am considering response only after 5 mins, then how do I know what was the volume traded in the last 5 minutes?

Thanks for any help on this.

are you able to invoke custommessage function which is assigned to websocketdata ?

I am able to see live data on console and in log file but the custom_message function is not getting calledback