Documentation

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.

Download: github.com/hangmann/bar6-dataconvert · Requires Python 3.9 or later.

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:

python --version

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:

python dataconvert.py

A window opens. Here's what to fill in:

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:

python dataconvert.py INPUT.csv OUTPUT.bin --symbol EURUSD --tf 5

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

# Tick CSV → M5 bars python dataconvert.py my_ticks.csv EURUSD_M5.bin --symbol EURUSD --tf 5 # MT4 bar CSV python dataconvert.py bars.csv DAX_M1.bin --symbol DAX40 --tf 1 --format mt4 # Generic OHLCV CSV (auto-detect) python dataconvert.py my_bars.csv BTCUSDT_H1.bin --symbol BTCUSDT --tf 60 # Check what’s in an existing .bin file python dataconvert.py --info my_data.bin

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 nameWhat it handles
no --formatAuto-detects from file extension and content (recommended). In the GUI this is the auto choice.
dukascopyDukascopy tick CSV (LocalTime, Ask, Bid, AskVolume, BidVolume)
mt4 / mt5MetaTrader 4/5 bar CSV
mt4hstMT4 binary .hst history file
tradingviewTradingView export (time, open, high, low, close, volume)
ninjatraderNinjaTrader bar CSV
tradestationTradeStation EasyLanguage bar CSV
binanceBinance historical klines (data.binance.vision, ms timestamps)
bybitBybit / Kraken / Coinbase OHLCV CSV (Unix second timestamps)
genericAny OHLCV CSV. Auto-detects columns, or use "Map Columns" in GUI
⚠ If auto-detection fails: Open the GUI and use the Map Columns… button to manually tell DataConvert which column is date, open, high, low, close. Most edge-case CSVs are solvable this way.

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:

python dataconvert.py ticks.csv MY_TICKS.bin --symbol EURUSD --tf 5 --ticks

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:

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.