Understand the offer and ask calcal for Ethereum orders
If you create a diagram to monitor order data, it is crucial to understand how the offer (BID) and the survey (ASC) prices are calculated. In this article we will break down the process of calculating the offer and ask the Kryptsy -API to Ethereum.
What are praying and asking prices?
BID (BID) Price squeezing the highest price that a buyer can pay for a asset at a certain point in time.
Ask (ask) Price contracts The lowest price that a seller accepts for a asset at a certain point in time.
How will pray and ask?
At Ethereum, the prices are calculated using real-time market data. The process includes:
- Call down market data : The Kryptsy -api -Retrievoven data from the servers of Ethereum Exchange.
- Price calculation : The API uses algorithms to calculate the offer and ask the prices based on the market data. These calculations typically include:
* Average true area (ATR)
* Average moves moved
* Relative strength index (rsi)
- Time temple
: The calculated commandment and the questions are stamped with the timeline with their respect time stamps.
- Price memory : The calculated bid and the inquiries are saved in a database or data structure, such an array or hash card.
Cryptsy API implementation
To implement the offer and request calculations in your diagram, you must:
- Register for a crypty account and receive access footers.
- Use the “Get /Markt /Bid” end point to access the offer prices, followed by the “Get /Market /ASK” end point to call up the prices.
`http
Get curl -x \
\
-H 'Authorization: Bearer your_access_token' \
-D 'id = 1'
Answer:
`Json
{
"Bid": [
{"Timestamp": 1643723400, "Price": 2,5435},
{"Timestamp": 1643719400, "Price": 2,5428}
"", ","
"Questions": [
{"Timestamp": 1643723400, "Price": 2,5447},
{"Timestamp": 1643719400, "Price": 2,5433}
]
}
Graph implementation
To display the bid and ask the prices in your diagram, you can use a data structure like an array or hash card to save the calculated prices. Here is a sample implementation with Python:
`Python
Import JSON
Class EtherMarket:
def __init __ (self):
self.bids = []
Self.aks = []
DEF GET_BIDS (self):
For the offer in self.bids:
Print (f "timestamp: {bid ['timestamp']}, price: {bid ['price']}")
DEF GET_AKS (self):
For questions in self.aks:
Print (f "timestamp: {ask ['timestamp']}, price: {ask ['price']}")
Example use
Markt = EtherMarket ()
Markt.get_bids ()
While true:
Response = input ("Get" Enter offers "to call up current prices or" end "to end:")
If answer == "exit":
break
Different:
Markt.Get_asks ()
This code ends the current offer and asks the prices from the “Get /Markt /Bid” or “Get /Markt /ASK”. You can use this implementation as a starting point for your diagram.
Tips and variations
- To improve performance, you should use a database like Redis or Mongodb to save the calculated prices.
- Consider add additional functions, e.g. B. filtering by pairs of wealth or timeline to improve the functionality of your diagram.
- If you call up the offer and request the prices of external APIs, be sure to follow best practices for security and interest limitation to avoid API rate limits.
If you follow the thesis steps and understand how the offer and questions use the Cryptsy -Pi to calculate the prices in Ethereum, you can create a powerful diagram that effectively visualizes the order data in your cryptocurrency market.