Skip to content

Conversation

@adamoverton
Copy link

Summary

  • Fixed ParseDatabentoContractSymbol() to parse from end of symbol (year digits → month code → root)
  • Added MonthCodeToMonth dictionary with all CME month codes (F,G,H,J,K,M,N,Q,U,V,X,Z)
  • Implemented IDataQueueUniverseProvider interface in DataBentoDataProvider
  • Added LookupSymbols() and CanPerformSelection() for futures universe support
  • Added comprehensive unit tests for contract parsing

Problem

The previous parsing logic failed for symbols like MYMH6 where the month code (H=March) appears within the root symbol (MYM). The parser would incorrectly identify M as the month code, resulting in wrong contract resolution.

Solution

Parse from the end of the symbol:

  1. Find where year digits end (working backwards)
  2. Month code is the character immediately before the year digits
  3. Root symbol is everything before the month code

Test cases verified

Databento Symbol Root Month Year
MYMH6 MYM March 2026
ESZ25 ES December 2025
NQM6 NQ June 2026
YMH26 YM March 2026
MESF7 MES January 2027
CLG26 CL February 2026

Test plan

  • Unit tests for ParseDatabentoContractSymbol with various symbol formats
  • Tests for spread symbol rejection (e.g., MYMH6-MYMM6)
  • Tests for empty/null input handling

🤖 Generated with Claude Code

adamoverton and others added 6 commits December 30, 2025 14:09
Update target framework from net9.0 to net10.0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Databento returns OHLCV prices as fixed-point integers scaled by 10^9.
The DatabentoBar class was parsing these as raw decimals, resulting in
prices like 6707750000000 instead of 6707.75.

- Change OHLCV fields from decimal to long (OpenRaw, HighRaw, etc.)
- Apply PriceScaleFactor (1e-9) to get actual prices
- Volume remains as long (not scaled)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Log history requests and rejection reasons at Trace level to help
debug DataBento integration issues.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Features:
- Add [Export] attribute for MEF plugin discovery
- Add intraday replay support via databento-replay-start config
  - "0" for full replay, ISO datetime for specific time, omit for 15-min default
- Support canonical (continuous) futures symbols
- Use tick-level schemas (trades, mbp-1) for live streaming
  - LEAN aggregator consolidates ticks into bars

Fixes:
- Fix volume parsing in OHLCV bars (parse string to long)

Improvements:
- Reduce logging verbosity (remove per-tick spam)
- Add controlled logging for trade bars (first 10, then every 50th)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The previous parsing logic failed for symbols like MYMH6 where the month
code (H=March) appears within the root symbol (MYM). The parser would
incorrectly identify M as the month code.

Changes:
- Parse from end of symbol: find year digits first, then month code
- Added MonthCodeToMonth dictionary with all CME month codes
- Added ParseDatabentoContractSymbol as public method for testing
- Added SymbolMappingReceived event for contract resolution tracking
- Implemented IDataQueueUniverseProvider interface in DataBentoDataProvider
- Added LookupSymbols() and CanPerformSelection() for futures universe support
- Track resolved contracts in _resolvedContracts dictionary
- Added comprehensive unit tests for contract parsing

Test cases verified:
- MYMH6 -> MYM March 2026 (bug case)
- ESZ25 -> ES December 2025
- NQM6 -> NQ June 2026
- YMH26 -> YM March 2026 (2-digit year)
- MESF7 -> MES January 2027
- CLG26 -> CL February 2026

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant