Okay, I used this code: depthdata = client.depth(symbol=symbol) biddepth =…
- User
Okay, I used this code: depth_data = client.depth(symbol=symbol) bid_depth = depth_data[‘bids’] ask_depth = depth_data[‘asks’] buy_qty = float(bid_depth[0][1]) if bid_depth else 0.0 sell_qty = float(ask_depth[0][1]) if ask_depth else 0.0 sell_price = float(ask_depth[1][0]) if ask_depth else 0.0 buy_price = float(bid_depth[1][0]) if bid_depth else 0.0 print(“bids: \t\t asks:”) print(“qty: price:\t\tqty: price:”) print(f"{buy_qty} | {buy_price}\t\t{sell_qty} | {sell_price}")
Buut it returned me: bids: asks: qty: price: qty: price: 8.897 | 236.58 8.38 | 236.61
What does it mean qty 8.897 and qty 8.38 is it mean 8380 or no ?
- Assistant
No, the quantities 8.897 and 8.38 do not represent monetary values. In this context, "qty" refers to the quantity or amount of a particular asset being bought or sold. It does not represent the dollar amount.
For example, if you are trading a cryptocurrency, these quantities may represent the number of units or tokens being bought or sold. The actual value of these units or tokens would depend on the current market price.
In this case, the output is showing that there are 8.897 units being offered for purchase at a price of 236.58, and 8.38 units being offered for sale at a price of 236.61. The units could be any kind of asset, such as coins, shares, or tokens, depending on the specific market you are trading in.
- User
OKay, but is it thausands or just units ?
- Assistant
The quantities mentioned, 8.897 and 8.38, are not necessarily in thousands. They are raw quantities or units, without any specific denomination mentioned in the code snippet you provided.
To determine the denomination or scale of these quantities, it would be helpful to refer to the specific trading platform or API documentation that you are using. The documentation should provide information on how the quantities are represented, such as whether they are in units, thousands, or any other specific denomination.