41 lines
1.6 KiB
Markdown
41 lines
1.6 KiB
Markdown
|
||
|
||
pip install --user duckdb python3-zstd
|
||
|
||
apk add py3-zstd py3-duckdb
|
||
|
||
|
||
|
||
#### pip3 install --user --break-system-packages databento
|
||
|
||
python csv_to_parquet.py "raw/*.gz" data_parquet
|
||
|
||
|
||
====================
|
||
|
||
# WARNING / NOTE:
|
||
|
||
Four things in the data that affect backtests:
|
||
|
||
1. Prices are not adjusted for rolls. This is a continuous series that switches
|
||
contracts 47 times, and the new contract usually trades above the old
|
||
one. Added up, those jumps come to +22.8% of return you never earned by
|
||
holding the futures. Raw prices show +565% over the period; roll-adjusted
|
||
prices show +442%.
|
||
|
||
2. Each bar is timestamped at its open. Sessions start with an 18:00 ET bar and end with a 16:59 bar. So the 09:30 bar covers 09:30:00–09:30:59, and its close isn't known until 09:31. A signal computed from a bar's close can't be filled any earlier than the next bar's open.
|
||
|
||
3. Rolls happen partway into the evening session, at 00:00 UTC, which is 19:00
|
||
or 20:00 ET. A session's first one or two hours are in the old contract and
|
||
the rest in the new one, so session-level highs and lows need the adjusted
|
||
prices. The roll day also moves from Sundays (2015–17) to Tuesdays or
|
||
Wednesdays (2024–26), which suggests a volume-based roll rule. Check with
|
||
your vendor that the rule uses only the previous day's volume, not same-day
|
||
volume, which would leak future information.
|
||
|
||
4. Minutes with no trades have no bar. Coverage averages 92% of minutes in
|
||
2015 and about 99% from 2021 on. The gaps are almost all overnight. Filling
|
||
in missing minutes with the last price creates flat bars that can distort
|
||
volatility and volume features, especially in the thinner early years.
|
||
|