microsoft / microsoft/qlib

how to convert 3-seconds market data to qlib bin?

Open
#1,713 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
48.7k
Forks
7.7k
PR merge metrics
No merged PRs in 30d

Description

I have my own 3-seconds market data in local mysql and want to conver these 3-sec data to qlib bin,
How do I convert?

I used to convert csv (3 seconds data) to qlib bin by using dump_bin.py, the result of bin files like this:

image

with postfix day.bin, actually my csv files like this, interval 3 seconds per row.
image

Can QLib recognize this format?

I used the below command to do conversion
python scripts\dump_bin.py dump_all --freq 3sec --csv_path F:\CB\csv --qlib_dir F:\CB\ckdata_qlib --symbol_field_name stock_code --date_field_name date --include_fields open,high,low,close,volume,money,factor,vwap,change

I know dump_bin.py can specify --freq 1min or 1d as input. How should I handle 3-seconds interval data format?

If I use XXX.3sec.bin as local dataset, then run workflow_by_code.py, it reported "ValueError: freq format is not supported, the freq should be like (n)month/mon, (n)week/w, (n)day/d, (n)minute/min"

I really want to analyse 3-seconds interval marketdata. who can help me ?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with scripts/dump_bin.py and workflow_by_code.py, then reproduce the shown command using --freq 3sec and the reported unsupported-frequency error. Trace how frequencies are parsed and validated. Done means the requested 3-second market data can be converted and recognized by the workflow without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, python
Domain
data
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.