Skip to content

Commit 1d99b7d

Browse files
committed
move ORDERFLOW_ADDED_COLUMNS to constant
1 parent 0a4f82b commit 1d99b7d

File tree

3 files changed

+16
-17
lines changed

3 files changed

+16
-17
lines changed

freqtrade/constants.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,19 @@
7171
# it has wide consequences for stored trades files
7272
DEFAULT_TRADES_COLUMNS = ["timestamp", "id", "type", "side", "price", "amount", "cost"]
7373
DEFAULT_ORDERFLOW_COLUMNS = ["level", "bid", "ask", "delta"]
74+
ORDERFLOW_ADDED_COLUMNS = [
75+
"trades",
76+
"orderflow",
77+
"imbalances",
78+
"stacked_imbalances_bid",
79+
"stacked_imbalances_ask",
80+
"max_delta",
81+
"min_delta",
82+
"bid",
83+
"ask",
84+
"delta",
85+
"total_trades",
86+
]
7487
TRADES_DTYPES = {
7588
"timestamp": "int64",
7689
"id": "str",

freqtrade/data/converter/orderflow.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,12 @@
99
import numpy as np
1010
import pandas as pd
1111

12-
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS, Config
12+
from freqtrade.constants import DEFAULT_ORDERFLOW_COLUMNS, ORDERFLOW_ADDED_COLUMNS, Config
1313
from freqtrade.exceptions import DependencyException
1414

1515

1616
logger = logging.getLogger(__name__)
1717

18-
ORDERFLOW_ADDED_COLUMNS = [
19-
"trades",
20-
"orderflow",
21-
"imbalances",
22-
"stacked_imbalances_bid",
23-
"stacked_imbalances_ask",
24-
"max_delta",
25-
"min_delta",
26-
"bid",
27-
"ask",
28-
"delta",
29-
"total_trades",
30-
]
31-
3218

3319
def _init_dataframe_with_trades_columns(dataframe: pd.DataFrame):
3420
"""

freqtrade/freqai/data_kitchen.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
from sklearn.model_selection import train_test_split
1717

1818
from freqtrade.configuration import TimeRange
19-
from freqtrade.constants import DOCS_LINK, Config
20-
from freqtrade.data.converter import ORDERFLOW_ADDED_COLUMNS, reduce_dataframe_footprint
19+
from freqtrade.constants import DOCS_LINK, ORDERFLOW_ADDED_COLUMNS, Config
20+
from freqtrade.data.converter import reduce_dataframe_footprint
2121
from freqtrade.exceptions import OperationalException
2222
from freqtrade.exchange import timeframe_to_seconds
2323
from freqtrade.strategy import merge_informative_pair

0 commit comments

Comments
 (0)