I will be happy to help create an article on the binance application interface for mapping an open and closed store.
Name of article: Open and closed binance application mapping for trade analysis
Introduction:
In this article, we present how to map the original order with the help of Binance API the same closed order in the market for a future contract. This is an important step in analysis of trading activity and identifying any models or anomalies.
Prerequisites:
- You have basic information on Binance application subscriptions and its features.
- You have a Bloomberg terminal or a similar platform designed to connect to the Binance program.
Step 1: Get API -License Information
You need to obtain a subscription key and a secret key to use the binance application connection. Do these steps:
- Go to [binance site] ( and create an account.
- Click “API” in the upper and navigation band.
- Click “Start”.
4
- Create a new API key and a secret key.
Step 2: Set Bloomberg Terminal
- Download the Bloomberg terminal [ (
- Set Bloomberg binance API connector with PIP:
`Bash
PIP to install binance-api transmission
`
- Add your Bloomberg account using the following settings:
- API Key: Binance API Key
- Secret key: Binance Key
- Host URL: [ (
- Set the account data flow:
+ Options: Select “API” as a type of data flow.
+ Endpoint: Select the access point you want to use (for example.
Step 3: Create Bloomberg Head Wash
Create a new script using this code:
`Python
Import the garbage bin
Set the API access information
API_KEY = "Your_API_KEY"
Api_secret = "Your_secret_key"
Set Bloomberg Terminal
Binance_connect = binance.binanceCeconnect (
API_KEY = API_KEY,
Secreg = API_SECRET,
Hosts = "
Inside
Create Bloomberg Terminal Input Object
Data_Feed = binance_connect.datfeeds.marketdatafeed (
Symbol = "BTCUSDT",
Feed Market Input
Interval = "1m"
data delivery (1 minute)
Inside
Set the feature to map open and closed orders
Def map_open_to_closed (data):
mapping = {}
Data sequence:
If Order.Status == "Open":
Mapped_order = {
"Symbol": Order.Symbol,
"Time Stamp": Order.Testamp,
"Quantity": Order.quantity,
"Price": order.Price
}
Elif Order.Status == "closed":
Mapped_order = {
"Symbol": Order.Symbol,
"Time Stamp": Order.Testamp,
"Quantity": Order.quantity,
"Price": order.Price
}
recovery mapping
Get the data delivery item 5 minutes ago
Data_Feed_object = Data_Feed.get_data (
symbol = "btcusdt",
Interval = "1m",
Starttime = "2022-01-01T00: 00: 00.000Z",
Endime = "2022-01-01T01: 00: 00.000Z"
Inside
Mapping of open and closed orders
Mapping = MAP_OPEN_TO_CLOSED (DATA_FEED_OBJECT)
Print mapping
Mapping sequence:
Print (F "{Order ['Symbol']}: {order ['Timestamp']}, Quantity: {order ['quantity']}, price: {order ['price']}})
Step 4: Complete the script and analyze the data
- Save the script in a file (eg map_open_to_closed.py).
- Run the script with Python:
`Bash
python map_open_to_closed.py
`
It prints open and closed orders for mapping within a specified period.
Leave a Reply