fixes around pivot points and BOM matrix
This commit is contained in:
@ -1507,8 +1507,15 @@ class DataProvider:
|
||||
timeframe_secs = self.timeframe_seconds.get(timeframe, 3600)
|
||||
current_time = tick['timestamp']
|
||||
|
||||
# Calculate candle start time
|
||||
candle_start = current_time.floor(f'{timeframe_secs}s')
|
||||
# Calculate candle start time using proper datetime truncation
|
||||
if isinstance(current_time, datetime):
|
||||
timestamp_seconds = current_time.timestamp()
|
||||
else:
|
||||
timestamp_seconds = current_time.timestamp() if hasattr(current_time, 'timestamp') else current_time
|
||||
|
||||
# Truncate to timeframe boundary
|
||||
candle_start_seconds = int(timestamp_seconds // timeframe_secs) * timeframe_secs
|
||||
candle_start = datetime.fromtimestamp(candle_start_seconds)
|
||||
|
||||
# Get current candle queue
|
||||
candle_queue = self.real_time_data[symbol][timeframe]
|
||||
|
Reference in New Issue
Block a user