mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
use fetch_trades' public trades to populate dataframe
This commit is contained in:
@@ -456,7 +456,8 @@ def ohlcv_fill_up_missing_data(dataframe: DataFrame, timeframe: str, pair: str)
|
||||
df.reset_index(inplace=True)
|
||||
len_before = len(dataframe)
|
||||
len_after = len(df)
|
||||
pct_missing = (len_after - len_before) / len_before if len_before > 0 else 0
|
||||
pct_missing = (len_after - len_before) / \
|
||||
len_before if len_before > 0 else 0
|
||||
if len_before != len_after:
|
||||
message = (f"Missing data fillup for {pair}: before: {len_before} - after: {len_after}"
|
||||
f" - {pct_missing:.2%}")
|
||||
@@ -501,7 +502,8 @@ def trim_dataframes(preprocessed: Dict[str, DataFrame], timerange,
|
||||
processed: Dict[str, DataFrame] = {}
|
||||
|
||||
for pair, df in preprocessed.items():
|
||||
trimed_df = trim_dataframe(df, timerange, startup_candles=startup_candles)
|
||||
trimed_df = trim_dataframe(
|
||||
df, timerange, startup_candles=startup_candles)
|
||||
if not trimed_df.empty:
|
||||
processed[pair] = trimed_df
|
||||
else:
|
||||
|
||||
@@ -2393,6 +2393,13 @@ class Exchange:
|
||||
now = arrow.utcnow().int_timestamp
|
||||
return plr < now
|
||||
|
||||
def _now_is_time_to_refresh_trades(self, pair: str, timeframe: str, candle_type: CandleType) -> bool:
|
||||
# Timeframe in seconds
|
||||
interval_in_sec = timeframe_to_seconds(timeframe)
|
||||
plr = self._trades_last_refresh_time.get((pair, timeframe, candle_type), 0) + interval_in_sec
|
||||
REFRESH_EARLIER_SECONDS = 5
|
||||
return plr < arrow.utcnow().int_timestamp - REFRESH_EARLIER_SECONDS
|
||||
|
||||
@retrier_async
|
||||
async def _async_get_candle_history(
|
||||
self,
|
||||
|
||||
Reference in New Issue
Block a user