Correction Data Corgoving Klinya with Uspolzing Information O Ticketers in Price Ethera from API
As a python spot trading bot, you, verbatim, are the Important access to the high -quality historical data for the information of your boring. One -in -law problems in the attachments for the intestation there is a half -information on the ticketers in the efir from the Api Exchange (interfaces of the compound program). In this state, we disperse, how to make the volume of the Kline, use information on the utte ticker from the API.
TRABING
Earsting in the solution of the impact that you have the following:
1.
- UCHED API : Count the API key and secrets.
3.
Shag 1: Set your midth python
Receive that in your system installation Python, as well as any non -existent libraries (for example, “requested”). You can install the PIP:
`Bash
Pip instques
Shag 2: Submit the Exchange API
Using the library, such as the requests, for the creation of the API client, which can be assembled from the public api exchange. For example, you can use the follow -up fragment of the code:
`Piton
Importies
Def Get_live_Ticker_data (Exchange_url, API_KEY, Secret):
URL = F "{Exchange_url}/API/V1/OHLCV"
Headers = {"X-API KEY": API_KY}
Response = Reques.get (URL, Zagolovki = Zagolovki)
Return Response.json ()
Change exchange_url
,API_KEY
and secret 'to the values presented by your component.
Shag 3: Data Immediately Data from the Life Ticker
Using the API client, take the data of the Kline for a finished coin with a 5-minute interval. You can change this fragment of the code into the correspondence with your need:
Piton
Live_Ticker_data = Get_live_Ticker_data (
"
"Your_api_Key_here",
"Your_secret_key_here"
)
Analyzing this CLINE as json
CLINE_DATA = LIVE_TICKER_DATA [0] ["OHLCV"]
PRINT (CLINE_DATA)
This is the printset and the 5-minute OHLCV (open, high, low, closed, lap) for a finished coin.
Shag 4: Prevailing Imperial and Holding Data Kline
To use these data in your volume, you need to prevail and coat them. One of the extended pickets is a vocabulary of the list, where every one is presenting the vocabulary with a one -point.
`Piton
CLINE_DATA = [[[[
{"Open": Float (kline_data ["0"]. Split (",") [1]), "high": kline_data ["2"]. : Kline_data ["3"]. ] Split (",") [1])}
Add more scoring data on the measure of the need ...
]
Hoping data CLINE in the database or file
JSON IMport
With Open ("kline_data.json", "w") as f:
json.dump (kine_data, f)
This will hide the data on the pre -trial line in the JSON file.
conclusion
The trace of the steps and the library, such as the “requested” for diminishness from the api, you can make high -legal data on the clinia from the dietary information about the tickeys. This allows your Python Spot Trading Bot to put out the complicated decrees on the basis of market data in the reality.
Do not forget all the way to consider the clerk and hand -running adjusts for each API and compliance with any rules in your region. Happy Wheely!