Skip to content

fix: add missing timeframes to granularity_order dict#418

Merged
MDUYN merged 1 commit intocoding-kitties:mainfrom
thakoreh:fix/granularity-order-missing-timeframes
Apr 5, 2026
Merged

fix: add missing timeframes to granularity_order dict#418
MDUYN merged 1 commit intocoding-kitties:mainfrom
thakoreh:fix/granularity-order-missing-timeframes

Conversation

@thakoreh
Copy link
Copy Markdown
Contributor

@thakoreh thakoreh commented Apr 4, 2026

The granularity_order dict in get_most_granular_ohlcv_data_source() was missing several timeframes that exist in the TimeFrame enum, causing a KeyError when backtesting with any of them.

Added: TWO_MINUTE, THREE_MINUTE, FOUR_MINUTE, TEN_MINUTE, TWENTY_MINUTE, THIRTY_MINUTE, SIX_HOUR, EIGHT_HOUR, THREE_DAY, ONE_YEAR

Values are minutes per timeframe, consistent with existing entries.

@MDUYN
Copy link
Copy Markdown
Collaborator

MDUYN commented Apr 5, 2026

Hey @thakoreh thanks for this fix! I just open an PR for this issue also, with exactly the same fixes: #419. I will first merge this one, and then my fix. Because, my fix also has some added tests.

@MDUYN MDUYN merged commit ef05db6 into coding-kitties:main Apr 5, 2026
1 check passed
@MDUYN
Copy link
Copy Markdown
Collaborator

MDUYN commented Apr 5, 2026

Fix is part of release v7.32

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.

2 participants