DataConvert
A free, open-source tool that converts historical market data CSV files into partiqon's BAR6 binary format. Runs entirely on your computer, so your raw data never leaves your machine.
Step 1: Install Python
DataConvert is a Python script. If you don't have Python, download it from python.org (version 3.9 or newer). During installation, check the box "Add Python to PATH".
To verify Python is installed, open a terminal (Windows: press Win + R, type cmd, press Enter) and type:
You should see something like Python 3.11.5. Any version 3.9+ works.
Step 2: Download DataConvert
Go to github.com/hangmann/bar6-dataconvert and download the ZIP file (click the green Code button → Download ZIP). Extract the ZIP to any folder, for example C:\DataConvert.
The only file you need is dataconvert.py.
Step 3: Your market data
partiqon is a bring-your-own-data platform. You need historical price data for the instrument you want to test: data you recorded yourself, exported from your own trading account, or are otherwise entitled to use.
We do not recommend specific data sources. What matters is that the data is in a format DataConvert can read (see the format table below) and that you have the right to use it for your own testing.
Step 4: Run DataConvert (GUI, easiest)
Open a terminal in the DataConvert folder (on Windows: hold Shift, right-click the folder → "Open PowerShell window here") and run:
A window opens. Here's what to fill in:
- Input File: click Browse and select your CSV (or .hst) file.
- Format: leave on "auto". It detects the common CSV formats (MT4, MT5, tick CSV, OHLCV, etc.) automatically. Change only if auto-detection fails.
- Symbol: the name you want to use in partiqon. Examples:
EURUSD,BTCUSDT,DAX40. Keep it short, no spaces. - Timeframe: in minutes. 1 = M1, 5 = M5, 60 = H1, 1440 = D1. For tick data this is the aggregation target.
- Output File: where to save the .bin file. Click Browse to choose a location.
Click Convert & Write .bin. The log at the bottom shows progress. When it says "DONE", your file is ready.
Step 4 (alternative): Command line
If you prefer the command line:
Swap INPUT.csv for your actual file, OUTPUT.bin for where to save, EURUSD for your symbol name, and 5 for timeframe in minutes.
Common examples
Step 5: Upload to partiqon
In the partiqon workspace, open the Settings panel, confirm that you own the data (or have the right to use it), and drop your .bin file onto the upload area. partiqon reads the symbol and timeframe from the file header and checks that the file is valid.
Supported input formats
| Format name | What it handles |
|---|---|
no --format | Auto-detects from file extension and content (recommended). In the GUI this is the auto choice. |
dukascopy | Dukascopy tick CSV (LocalTime, Ask, Bid, AskVolume, BidVolume) |
mt4 / mt5 | MetaTrader 4/5 bar CSV |
mt4hst | MT4 binary .hst history file |
tradingview | TradingView export (time, open, high, low, close, volume) |
ninjatrader | NinjaTrader bar CSV |
tradestation | TradeStation EasyLanguage bar CSV |
binance | Binance historical klines (data.binance.vision, ms timestamps) |
bybit | Bybit / Kraken / Coinbase OHLCV CSV (Unix second timestamps) |
generic | Any OHLCV CSV. Auto-detects columns, or use "Map Columns" in GUI |
Frequently asked questions
My CSV has a weird date format. Will it work?
Probably. DataConvert recognises DD.MM.YYYY, YYYY-MM-DD, MM/DD/YYYY, NinjaTrader's compact YYYYMMDD HHMMSS, Unix timestamps in seconds, and Unix timestamps in milliseconds. If your format is something else, use the generic format with Map Columns.
How big will the .bin file be?
Bar files use 56 bytes per bar. A 5-year M5 dataset (≈260,000 bars) is about 14 MB. Tick files use 32 bytes per tick; a full year of dense FX tick data is typically in the range of 500 MB–1 GB depending on the instrument.
Can I use tick data for backtesting?
Yes. If your data is raw tick-level CSV (bid/ask per tick), add the --ticks flag to save raw ticks instead of aggregated bars:
The --tf value is ignored when --ticks is set. A tick file is backtested tick by tick; to work on bars, add an Aggregator.TickToBar block to your graph.
DataConvert refused my file: "the records are not in time order"
DataConvert will not write a .bin whose records do not run forwards in time, because every consumer (the backtest engine included) reads them as if they do. The message names the offending records and their exact timestamps. The usual causes:
- Two exports stitched together in the wrong order. Sort the CSV by its timestamp column and convert again.
- Two exports whose date ranges overlap. The overlapping rows appear twice; remove the duplicates from one of them.
- Raw ticks only: converting the same file to bars instead (drop
--ticksand pass--tf) sorts the rows for you.
DataConvert refused my file: two bars share a timestamp
Two bars stamped the same minute would count that minute twice in every backtest, so the conversion stops instead of producing a file that looks intact. The usual cause is two exports whose date ranges overlap.
The other one used to be the autumn clock change, and is handled for you now. Formats that store a bare local wall clock (MT4/MT5, NinjaTrader, TradeStation, generic) carry the repeated hour twice under one label on the night the clocks go back. If you pass a zone name to --tz (Europe/Helsinki, Europe/Berlin), DataConvert knows where that zone’s transitions are and reads the second copy of the hour as the repeated one, by its position in the file. Nothing to edit.
A fixed offset (--tz +02:00) has no transitions, so it cannot tell the two copies apart and the conversion still stops. If your broker’s server clock observes daylight saving, pass the zone name instead of the offset. If it genuinely does not, the offset is right and a duplicate really is an overlapping export.
DataConvert refuses my file: a time that does not exist
On the morning the clocks go forward an hour of local time is skipped. In Europe/Helsinki on 31 March 2024 the clock jumped straight from 03:00 to 04:00, so no clock in that zone ever read 03:30 that day. A row with such a label cannot be converted, only invented, and the instant that would be invented for it is the one the real row an hour later already has.
Almost always this means the --tz is not the file’s zone: a broker whose server clock does not observe daylight saving, read as a zone that does. Pass that server’s fixed offset instead (--tz +02:00), or the zone the file was really exported in. The message names the rows.
I get "Python is not recognized"
Python isn't in your system PATH. Reinstall Python from python.org and check "Add Python to PATH" during setup. Or find Python manually: on Windows, search for python.exe in C:\Users\YourName\AppData\Local\Programs\Python and use the full path.