API Huge value avg_traded_price"=>4294966909, - TECHM

dhavalp
{"instrument_token"=>136385284, "last_traded_price"=>45595, "last_traded_qty"=>2, "avg_traded_price"=>4294966909, "vol_traded_for_day"=>132968, "total_buy_qty"=>5786, "total_sell_qty"=>4155, "open_price"=>44600, "high_price"=>45780, "low_price"=>44375, "close_price"=>44475, "bid_entries"=>[{:qty=>170, :price=>45595, :orders=>262148}, {:qty=>32766, :price=>78361, :orders=>12386493}, {:qty=>32766, :price=>78356, :orders=>2147385342}, {:qty=>40958, :price=>86580, :orders=>2147385342}, {:qty=>40994, :price=>86580, :orders=>2684526594}], "offer_entries"=>[{:qty=>25131, :price=>45599, :orders=>393222}, {:qty=>51659, :price=>45603, :orders=>1647272495}, {:qty=>71182, :price=>62319, :orders=>186321691}, {:qty=>79374, :price=>70543, :orders=>370021902}, {:qty=>79411, :price=>70543, :orders=>907032080}]}

Is it possible that we receive such huge value in the avg_traded_price?
  • Kailash
    Looks like the numbers were not cast properly. These values look overflown.
  • dhavalp
    So my concern is that these types of values were received from the API. Is it possible that I receive such in the future and make provision for it?
  • dhavalp
    Pls reply so that I can make the provision accordingly.
  • Kailash
    Kailash edited April 2016
    @dhavalp These values are definitely not from the API. I believe you've cast the numbers incorrectly and they are overflowing, which is why you are seeing such large numbers.
  • dhavalp
    the raw_data i sent to you is received from web socket client
    [0, 250, 0, 164, 7, 163, 3, 4, 0, 0, 153, 132, 0, 0, 0, 45, 255, 255, 254, 239, 0, 0, 108, 72, 0, 0, 63, 235, 0, 0, 38, 55, 0, 0, 152, 123, 0, 0, 154, 6, 0, 0, 151, 39, 0, 0, 151, 99, 0, 0, 0, 6, 0, 0, 153, 207, 0, 1, 0, 1, 0, 0, 0, 18, 0, 0, 153, 187, 0, 6, 0, 6, 0, 0, 1, 238, 0, 0, 153, 182, 0, 19, 0, 19, 0, 0, 0, 9, 0, 0, 153, 172, 1, 237, 1, 237, 0, 0, 0, 89, 0, 0, 153, 162, 0, 10, 0, 10, 0, 0, 0, 81, 0, 0, 153, 222, 0, 1, 0, 1, 0, 0, 0, 27, 0, 0, 153, 247, 0, 81, 0, 81, 0, 0, 0, 7, 0, 0, 153, 252, 0, 27, 0, 27, 0, 0, 0, 56, 0, 0, 154, 6, 0, 8, 0, 8, 0, 0, 0, 10, 0, 0, 154, 16, 0, 55, 0, 55, 0, 164, 1, 3, 141, 2, 0, 1, 242, 62, 0, 0, 1, 44, 0, 1, 242, 9, 0, 1, 219, 200, 0, 0, 166, 104, 0, 0, 196, 224, 0, 1, 237, 102, 0, 1, 245, 34, 0, 1, 234, 60, 0, 1, 237, 202, 0, 0, 1, 44, 0, 1, 242, 17, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 242, 12, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 241, 218, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 241, 208, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 241, 193, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 242, 102, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 242, 152, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 242, 197, 0, 1, 0, 0, 0, 0, 1, 44, 0, 1, 242, 207, 0, 1, 0, 0, 0, 0, 2, 88, 0, 1, 242, ]

    in the array, element 16 to 19 is (255, 255, 254, 239), this is for average traded price, (https://kite.trade/docs/connect/v1/#packet-structure)
    if convert to hex, it will be FF FF FE EF, in decimal number it is 4294967023
    is there anything wrong with my calculation?

Sign In or Register to comment.