mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-16 12:51:14 +00:00
Ruff --fix
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
"""
|
||||
Functions to convert data from one format to another
|
||||
"""
|
||||
import itertools
|
||||
import logging
|
||||
import time
|
||||
from typing import Dict
|
||||
@@ -125,7 +124,7 @@ def populate_dataframe_with_trades(config: Config, dataframe: DataFrame, trades:
|
||||
pd.Timedelta(minutes=timeframe_minutes)
|
||||
# skip if there are no trades at next candle because that this candle isn't finished yet
|
||||
# if not np.any((candle_next == df.candle_start)):
|
||||
if not candle_next in trades_grouped_by_candle_start.groups:
|
||||
if candle_next not in trades_grouped_by_candle_start.groups:
|
||||
logger.warning(
|
||||
f"candle at {candle_start} with {len(trades_grouped_df)} trades might be unfinished, because no finished trades at {candle_next}")
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ from pandas import DataFrame, Timedelta, Timestamp, to_timedelta
|
||||
|
||||
from freqtrade.configuration import TimeRange
|
||||
from freqtrade.constants import (FULL_DATAFRAME_THRESHOLD, Config, ListPairsWithTimeframes,
|
||||
ListTicksWithTimeframes, PairWithTimeframe)
|
||||
PairWithTimeframe)
|
||||
from freqtrade.data.converter import public_trades_to_dataframe
|
||||
from freqtrade.data.history import load_pair_history
|
||||
from freqtrade.data.history.idatahandler import get_datahandler
|
||||
|
||||
@@ -2406,7 +2406,7 @@ class Exchange:
|
||||
# Timeframe in seconds
|
||||
df = self.klines((pair, timeframe, candle_type), True)
|
||||
_calculate_ohlcv_candle_start_and_end(df, timeframe)
|
||||
interval_in_sec = timeframe_to_seconds(timeframe)
|
||||
timeframe_to_seconds(timeframe)
|
||||
# plr = self._trades_last_refresh_time.get((pair, timeframe, candle_type), 0) + interval_in_sec
|
||||
plr = round(df.iloc[-1]["candle_end"].timestamp())
|
||||
now = int(timeframe_to_prev_date(timeframe).timestamp())
|
||||
|
||||
@@ -1,18 +1,10 @@
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
import arrow
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
import pytest
|
||||
from pandas import DataFrame
|
||||
|
||||
from freqtrade.configuration import Configuration
|
||||
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS
|
||||
from freqtrade.data.converter import populate_dataframe_with_trades, public_trades_to_dataframe
|
||||
from freqtrade.data.converter.converter import trades_to_volumeprofile_with_total_delta_bid_ask
|
||||
from freqtrade.enums import CandleType, MarginMode, TradingMode
|
||||
from freqtrade.exchange.exchange import timeframe_to_minutes
|
||||
|
||||
|
||||
BIN_SIZE_SCALE = 0.5
|
||||
|
||||
Reference in New Issue
Block a user