Revert PR #2027, breaks with prepost=True

This commit is contained in:
ValueRaider
2024-08-21 21:11:52 +01:00
parent 4941c619f4
commit 1baecc9d5b

View File

@@ -227,9 +227,7 @@ class PriceHistory:
# 2) fix weired bug with Yahoo! - returning 60m for 30m bars
if interval.lower() == "30m":
logger.debug(f'{self.ticker}: resampling 30m OHLC from 15m')
exchangeStartTime = pd.Timestamp(self._history_metadata["tradingPeriods"][0][0]["start"], unit='s')
offset = str(exchangeStartTime.minute % 30)+"min"
quotes2 = quotes.resample('30min', offset=offset)
quotes2 = quotes.resample('30min')
quotes = pd.DataFrame(index=quotes2.last().index, data={
'Open': quotes2['Open'].first(),
'High': quotes2['High'].max(),