Market Data Target Schema
Installation
Install the SDK using pip:
pip install blockhouse==1.0.16Sending Market Data
The send_market_data method supports sending consolidated order book data based on the Market Data schema. Below are the details of the required and optional fields for the input.
from blockhouse import MarketClient
# Initialize the client
client = MarketClient("f6d8d388f0c3c1479d5b30cb43d5346d")
# Send the market data
response = client.send_market_data(market_data)Input Schema
The send_market_data method accepts a dictionary containing the following fields:
Field Name
Data Type
Description
Example
timestamp
str
Timestamp of the order event.
2024-07-31T20:07:25
ask_price_0
float
Ask price at level 0.
102.578125
ask_size_0
int
Ask size at level 0.
5
ask_price_1
float
Ask price at level 1.
103.578125
ask_size_1
int
Ask size at level 1.
10
ask_price_2
float
Ask price at level 2.
104.578125
ask_size_2
int
Ask size at level 2.
15
ask_price_3
float
Ask price at level 3.
105.578125
ask_size_3
int
Ask size at level 3.
20
ask_price_4
float
Ask price at level 4.
106.578125
ask_size_4
int
Ask size at level 4.
25
ask_price_5
float
Ask price at level 5.
107.578125
ask_size_5
int
Ask size at level 5.
30
ask_price_6
float
Ask price at level 6.
108.578125
ask_size_6
int
Ask size at level 6.
35
ask_price_7
float
Ask price at level 7.
109.578125
ask_size_7
int
Ask size at level 7.
40
ask_price_8
float
Ask price at level 8.
110.578125
ask_size_8
int
Ask size at level 8.
45
ask_price_9
float
Ask price at level 9.
111.578125
ask_size_9
int
Ask size at level 9.
50
bid_price_0
float
Bid price at level 0.
101.578125
bid_size_0
int
Bid size at level 0.
4
bid_price_1
float
Bid price at level 1.
100.578125
bid_size_1
int
Bid size at level 1.
8
bid_price_2
float
Bid price at level 2.
99.578125
bid_size_2
int
Bid size at level 2.
12
bid_price_3
float
Bid price at level 3.
98.578125
bid_size_3
int
Bid size at level 3.
16
bid_price_4
float
Bid price at level 4.
97.578125
bid_size_4
int
Bid size at level 4.
20
bid_price_5
float
Bid price at level 5.
96.578125
bid_size_5
int
Bid size at level 5.
24
bid_price_6
float
Bid price at level 6.
95.578125
bid_size_6
int
Bid size at level 6.
28
bid_price_7
float
Bid price at level 7.
94.578125
bid_size_7
int
Bid size at level 7.
32
bid_price_8
float
Bid price at level 8.
93.578125
bid_size_8
int
Bid size at level 8.
36
bid_price_9
float
Bid price at level 9.
92.578125
bid_size_9
int
Bid size at level 9.
40
symbol
str
Represents the security symbol.
"AAPL"
Example Usage
Response Schema
The send_market_data method returns a structured response, adhering to the following schema:
Field
Data Type
Description
Example
status
str
Indicates whether the operation was successful.
"success"
message
str
Describes the status of the operation.
"Market data successfully sent."
Example Response
Successful API calls return a response similar to the following:
Installation
Install the SDK using pip:
Sending Market Data
The send_market_data method also supports an alternative schema with simplified fields. Below are the details of the required and optional fields.
Input Schema
The send_market_data method accepts a dictionary containing the following fields:
Field Name
Data Type
Description
Example
timestamp_ny
str
Timestamp of the order event.
2024-07-31T20:07:25
side
str
Order side (Bid or Ask).
Bid
price
float
Market price.
102.578125
size
int
Order size.
4
symbol
str
Represents the security symbol.
10_YEAR
action
str
Specifies the type of action for the order (e.g., add, modify, or cancel).
add
order_type
str
Defines the type of order execution, such as market, limit, or stop-limit.
limit
Example Usage
Response Schema
The send_market_data method returns a structured response, adhering to the following schema:
Field
Data Type
Description
Example
status
str
Indicates whether the operation was successful.
"success"
message
str
Describes the status of the operation.
"Market data successfully sent."
Example Response
Successful API calls return a response similar to the following:
Last updated