Skip to content
All library documents

Importing Ricequant Daily Futures Bars into VeighNa MongoDB

Article vn.py community

Summary

This guide describes a workflow for moving historical daily futures bars from Ricequant into a local VeighNa database backed by MongoDB. It first uses Ricequant’s research environment to retrieve listed futures contracts and daily price fields over a chosen date range, then saves the data as a CSV file. In a local Jupyter notebook, pandas loads the file, groups records by contract, and converts each row into VeighNa bar objects with exchange, timestamp, price, volume, turnover, and open-interest fields before saving them through the database interface.

The author says this approach was easier and more stable for them than scraping data or maintaining a custom crawler. The example covers daily bars and a China-market dataset; it does not demonstrate minute-bar imports, which the author notes would involve substantially more data and were untested. The process also depends on contract-to-exchange metadata and compatible database and library versions, so users should check mappings, timestamps, and imported records for their own setup. No data-quality comparison or validation results are provided.

Key ideas

  • Ricequant can provide historical daily futures bars for export to CSV.
  • The import process groups the data by contract and converts rows into VeighNa bar records.
  • Exchange mappings and timezone-aware timestamps are needed when constructing the records.
  • The described workflow covers daily data; minute-bar importing is suggested but untested.
  • The post provides no data-quality checks or comparison against another source.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.