BAR6 Format
partiqon's binary data format for efficient, transparent storage and retrieval of market data. Designed for speed, compact storage, and no vendor lock-in.
Overview
BAR6 is an open, documented binary format for storing historical market data. It supports both bar data (OHLCV) and raw tick data, with bid/ask information. Unlike proprietary formats, BAR6 is fully documented and designed to be read by any tool.
File Structure
Every BAR6 file starts with a binary header, followed by records:
Header (24 bytes)
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 4 | uint32 | magic | 0xB16B4246 ("BAR6" in little-endian) |
| 4 | 1 | uint8 | version | Format version (1 = current) |
| 5 | 1 | uint8 | data_type | 0 = bar, 1 = tick |
| 6 | 1 | uint8 | timeframe_minutes | Aggregation period (e.g., 5 = M5) |
| 7 | 33 | string | symbol | Null-terminated instrument name |
Bar Record (44 bytes each)
Each bar contains open, high, low, close prices and volume:
| Offset | Size | Type | Field | Description |
|---|---|---|---|---|
| 0 | 8 | int64 | timestamp | Unix milliseconds |
| 8 | 8 | double | open | Opening price |
| 16 | 8 | double | high | Highest price in bar |
| 24 | 8 | double | low | Lowest price in bar |
| 32 | 8 | double | close | Closing price |
| 40 | 4 | uint32 | volume | Number of ticks |
Tick Record (34 bytes each)
Each tick record contains a bid, ask, and volume:
| Offset | Size | Type | Field |
|---|---|---|---|
| 0 | 8 | int64 | timestamp (Unix milliseconds) |
| 8 | 8 | double | bid |
| 16 | 8 | double | ask |
| 24 | 4 | uint32 | bid_volume |
| 28 | 4 | uint32 | ask_volume |
Converting Your Data
Use DataConvert to convert your historical data (CSV, MT4 .hst) into BAR6 format. DataConvert runs locally on your machine — your raw data never leaves your PC.
- Input: CSV (timestamp, open, high, low, close, volume) or MT4 .hst
- Output: .bin file in BAR6 format
- Tool: github.com/hangmann/bar6-dataconvert
Why BAR6?
- Compact: 44 bytes per bar, 34 bytes per tick — efficient storage and fast reads
- Documented: Complete specification, no proprietary mystery
- Transparent: Read BAR6 files with any language (C++, Python, Java, etc.) — not locked to one platform
- Your data, your rules: Convert once, use everywhere
Reading BAR6 Programmatically
BAR6 is simple enough to read in any language. Here's Python pseudocode: