COB fixes

This commit is contained in:
Dobromir Popov
2025-08-08 19:15:07 +03:00
parent 0e469c8e2f
commit be1753c96a
5 changed files with 875 additions and 31 deletions

View File

@ -168,7 +168,7 @@ class StandardizedDataProvider(DataProvider):
# Attach COB heatmap (visual+model optional input), fixed scope defaults
try:
times, prices, matrix = self.get_cob_heatmap_matrix(
times, prices, matrix, mids = self.get_cob_heatmap_matrix(
symbol=symbol,
seconds=300,
bucket_radius=10,
@ -177,6 +177,10 @@ class StandardizedDataProvider(DataProvider):
base_input.cob_heatmap_times = times
base_input.cob_heatmap_prices = prices
base_input.cob_heatmap_values = matrix
# We also store mids in market_microstructure for optional use
if not hasattr(base_input, 'market_microstructure') or base_input.market_microstructure is None:
base_input.market_microstructure = {}
base_input.market_microstructure['heatmap_mid_prices'] = mids
except Exception as _hm_ex:
logger.debug(f"COB heatmap not attached for {symbol}: {_hm_ex}")