totalorganfailure commited on
Commit
df2449d
·
verified ·
1 Parent(s): 3abc2a6

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +32 -32
README.md CHANGED
@@ -1,59 +1,59 @@
1
  ---
2
  license: mit
3
- task_categories:
4
- - time-series-forecasting
5
- tags:
6
- - finance
7
- - market-data
8
- - order-book
9
- - high-frequency
10
- size_categories:
11
- - 1M<n<10M
12
  ---
13
 
14
  # LOBSTER Sample Data
15
 
16
- This dataset contains sample LOBSTER (Limit Order Book System - The Efficient Reconstructor) market data for several stocks from June 21, 2012.
17
 
18
- ## Dataset Description
19
 
20
- LOBSTER provides limit order book data reconstructed from NASDAQ TotalView-ITCH messages. This sample dataset includes:
21
 
22
- - **AAPL** (Apple Inc.) - 50 levels
23
- - **MSFT** (Microsoft Corporation) - 50 levels
24
- - **SPY** (SPDR S&P 500 ETF Trust) - 50 levels
25
- - **GOOG** (Google Inc.) - 10 levels
 
 
26
 
27
  ## File Structure
28
 
29
- Each ticker has two CSV files:
30
-
31
- 1. **Message file** (`*_message_*.csv`): Contains all order book events
32
  - Columns: time, event_type, order_id, size, price, direction
33
- - Event types: 1=New Order, 2=Cancellation, 3=Deletion, 4=Execution(Visible), 5=Execution(Hidden), 7=Trading Halt
34
 
35
- 2. **Orderbook file** (`*_orderbook_*.csv`): Contains order book snapshots after each event
36
  - Columns: ask_price_1, ask_size_1, bid_price_1, bid_size_1, ... (up to N levels)
37
- - Prices are in fixed-point format (multiply by 10^-4 for actual price)
38
 
39
  ## Usage
40
 
41
  ```python
42
  from huggingface_hub import hf_hub_download
43
- import pandas as pd
44
 
45
  message_file = hf_hub_download(
46
- repo_id="YOUR_USERNAME/lobster-data",
47
  filename="LOBSTER_SampleFile_AAPL_2012-06-21_50/AAPL_2012-06-21_34200000_37800000_message_50.csv",
48
  repo_type="dataset"
49
  )
50
 
51
- orderbook_file = hf_hub_download(
52
- repo_id="YOUR_USERNAME/lobster-data",
53
- filename="LOBSTER_SampleFile_AAPL_2012-06-21_50/AAPL_2012-06-21_34200000_37800000_orderbook_50.csv",
54
- repo_type="dataset"
55
- )
56
-
57
- messages = pd.read_csv(message_file, header=None)
58
- orderbook = pd.read_csv(orderbook_file, header=None)
 
 
 
59
  ```
 
 
 
 
 
 
1
  ---
2
  license: mit
3
+ viewer: false
 
 
 
 
 
 
 
 
4
  ---
5
 
6
  # LOBSTER Sample Data
7
 
8
+ Raw LOBSTER (Limit Order Book System) L3 order book data for June 21, 2012.
9
 
10
+ **Important:** These are raw CSV files without headers. They cannot be automatically loaded by HuggingFace viewers. Use the loading code below with custom schemas.
11
 
12
+ ## Available Datasets
13
 
14
+ - **AAPL**: 1, 5, 10, 30, 50 levels
15
+ - **AMZN**: 1, 5, 10 levels
16
+ - **GOOG**: 1, 5, 10 levels
17
+ - **INTC**: 1, 5, 10 levels
18
+ - **MSFT**: 1, 5, 10, 30, 50 levels
19
+ - **SPY**: 30, 50 levels
20
 
21
  ## File Structure
22
 
23
+ 1. **Message file** (`*_message_*.csv`): Order book events (6 columns, no header)
 
 
24
  - Columns: time, event_type, order_id, size, price, direction
25
+ - Types: 1=New, 2=Cancel, 3=Delete, 4=Exec(Visible), 5=Exec(Hidden), 7=Halt
26
 
27
+ 2. **Orderbook file** (`*_orderbook_*.csv`): Order book snapshots (4N columns, no header)
28
  - Columns: ask_price_1, ask_size_1, bid_price_1, bid_size_1, ... (up to N levels)
29
+ - Prices in fixed-point (multiply by 10^-4)
30
 
31
  ## Usage
32
 
33
  ```python
34
  from huggingface_hub import hf_hub_download
35
+ import polars as pl
36
 
37
  message_file = hf_hub_download(
38
+ repo_id="totalorganfailure/lobster-data",
39
  filename="LOBSTER_SampleFile_AAPL_2012-06-21_50/AAPL_2012-06-21_34200000_37800000_message_50.csv",
40
  repo_type="dataset"
41
  )
42
 
43
+ # Define schema for message file
44
+ MESSAGE_SCHEMA = {
45
+ "time": pl.Float64,
46
+ "type": pl.Int8,
47
+ "order_id": pl.Int64,
48
+ "size": pl.Int32,
49
+ "price": pl.Int64,
50
+ "direction": pl.Int8,
51
+ }
52
+
53
+ messages = pl.read_csv(message_file, has_header=False, schema=MESSAGE_SCHEMA)
54
  ```
55
+
56
+ ## More Information
57
+
58
+ - https://lobsterdata.com/
59
+ - https://lobsterdata.com/info/DataSamples.php