Skip to content

fix: add missing TimeFrame members to granularity_order#419

Merged
MDUYN merged 1 commit intodevfrom
fix/417-granularity-order-missing-timeframes
Apr 5, 2026
Merged

fix: add missing TimeFrame members to granularity_order#419
MDUYN merged 1 commit intodevfrom
fix/417-granularity-order-missing-timeframes

Conversation

@MDUYN
Copy link
Copy Markdown
Collaborator

@MDUYN MDUYN commented Apr 4, 2026

Summary

Fixes #417granularity_order in vector_backtest_service.py was missing SIX_HOUR, EIGHT_HOUR, THREE_DAY, THIRTY_MINUTE, and several other TimeFrame enum members, causing a KeyError when strategies use these timeframes in vector backtests.

Changes

  • vector_backtest_service.py: Added all TimeFrame enum members to granularity_order with minute-based rank values
  • New tests: 6 unit tests in test_granularity_order.py covering all previously-crashing timeframes and verifying correct ordering

Testing

python -m pytest tests/app/backtesting/test_granularity_order.py -v
# 6 passed

Closes #417

The granularity_order dict in vector_backtest_service.py was missing
SIX_HOUR, EIGHT_HOUR, THREE_DAY, THIRTY_MINUTE, and several other
TimeFrame members, causing KeyError when strategies use these timeframes.

Added all TimeFrame enum members with minute-based rank values.
Added 6 unit tests covering the previously-crashing timeframes.
@MDUYN MDUYN merged commit bbb870f into dev Apr 5, 2026
7 checks passed
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