I am trying to create a graph to moniter order data, similar to:


I am using the cryptsy api (http://pubapi.cryptsy.com/api.php?method=orderdatav2) to fetch all the order data and for each coins it returns some thing like:

          "price": "395.00000000",
          "quantity": "0.00100000",
          "total": "0.39500000"

The question that I have is, is there any formula or some thing to calculate bid and ask, so that I can plot the graph?



Generally, the ask price displayed by the exchanges is the sell order at the lowest price. Ask is another way of saying sell. So Ask order = Sell order.

The same for bid orders. The bid price is the buy order at the highest price.

Speaking for the result of the below API call:


The order with lowest price among the "sellorders" is the Ask.

The order with the highest price among the "buyorders" is the Bid.

This is true for any trading pair.

There seems to be pairs where "buyorders" is null. That is either an error on their part or there are no bids for those pairs.

| improve this answer | |
  • So, for each coin pairs, I will have to check every sellorder for the lowest price and every buyorder for highest price and together that one point gives a point to plot the graph as in the link given in my question? – Criesto Jul 2 '14 at 11:03
  • Well... To plot that graph, yes you need to go through all orders. Any point in the graph shows the total amount of orders up to that price. – Emre Kenci Jul 2 '14 at 11:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.