mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Compare commits
30 Commits
b36af1df6a
...
e908bee54e
Author | SHA1 | Date | |
---|---|---|---|
|
e908bee54e | ||
|
2fe67edab3 | ||
|
167e43cbef | ||
|
d8cb407c25 | ||
|
9452afe3f7 | ||
|
8dc6d9ce7d | ||
|
bf4b8a318d | ||
|
20f6022050 | ||
|
65e6c737cd | ||
|
6d2572e347 | ||
|
52a35197c7 | ||
|
2b3a41db3e | ||
|
09c1459411 | ||
|
98f18b89da | ||
|
4249db4330 | ||
|
a7f46500ed | ||
|
c73fa2b0eb | ||
|
db4c4b971a | ||
|
e9ccc98ada | ||
|
11d6ec33b3 | ||
|
c3b6f4ca85 | ||
|
d37405a307 | ||
|
d7a9841328 | ||
|
cf3af42477 | ||
|
ad8e6e7d67 | ||
|
705d1e4cc0 | ||
|
5b3f348bbb | ||
|
aa81c75bef | ||
|
6b889814ad | ||
|
1ade11f00b |
|
@ -16,7 +16,7 @@ repos:
|
|||
additional_dependencies:
|
||||
- types-cachetools==5.5.0.20240820
|
||||
- types-filelock==3.2.7
|
||||
- types-requests==2.32.0.20240907
|
||||
- types-requests==2.32.0.20240914
|
||||
- types-tabulate==0.9.0.20240106
|
||||
- types-python-dateutil==2.9.0.20240906
|
||||
- SQLAlchemy==2.0.34
|
||||
|
|
|
@ -3594,7 +3594,7 @@ class Exchange:
|
|||
Wherein, "+" or "-" depends on whether the contract goes long or short:
|
||||
"-" for long, and "+" for short.
|
||||
|
||||
okex: https://www.okex.com/support/hc/en-us/articles/
|
||||
okex: https://www.okx.com/support/hc/en-us/articles/
|
||||
360053909592-VI-Introduction-to-the-isolated-mode-of-Single-Multi-currency-Portfolio-margin
|
||||
|
||||
:param pair: Pair to calculate liquidation price for
|
||||
|
|
|
@ -47,19 +47,20 @@ class BaseEnvironment(gym.Env):
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
df: DataFrame = DataFrame(),
|
||||
prices: DataFrame = DataFrame(),
|
||||
reward_kwargs: dict = {},
|
||||
*,
|
||||
df: DataFrame,
|
||||
prices: DataFrame,
|
||||
reward_kwargs: dict,
|
||||
window_size=10,
|
||||
starting_point=True,
|
||||
id: str = "baseenv-1", # noqa: A002
|
||||
seed: int = 1,
|
||||
config: dict = {},
|
||||
config: dict,
|
||||
live: bool = False,
|
||||
fee: float = 0.0015,
|
||||
can_short: bool = False,
|
||||
pair: str = "",
|
||||
df_raw: DataFrame = DataFrame(),
|
||||
df_raw: DataFrame,
|
||||
):
|
||||
"""
|
||||
Initializes the training/eval environment.
|
||||
|
|
|
@ -488,7 +488,7 @@ def make_env(
|
|||
seed: int,
|
||||
train_df: DataFrame,
|
||||
price: DataFrame,
|
||||
env_info: Dict[str, Any] = {},
|
||||
env_info: Dict[str, Any],
|
||||
) -> Callable:
|
||||
"""
|
||||
Utility function for multiprocessed env.
|
||||
|
|
|
@ -214,7 +214,7 @@ class FreqaiDataKitchen:
|
|||
self,
|
||||
unfiltered_df: DataFrame,
|
||||
training_feature_list: List,
|
||||
label_list: List = list(),
|
||||
label_list: Optional[List] = None,
|
||||
training_filter: bool = True,
|
||||
) -> Tuple[DataFrame, DataFrame]:
|
||||
"""
|
||||
|
@ -244,7 +244,7 @@ class FreqaiDataKitchen:
|
|||
# we don't care about total row number (total no. datapoints) in training, we only care
|
||||
# about removing any row with NaNs
|
||||
# if labels has multiple columns (user wants to train multiple modelEs), we detect here
|
||||
labels = unfiltered_df.filter(label_list, axis=1)
|
||||
labels = unfiltered_df.filter(label_list or [], axis=1)
|
||||
drop_index_labels = pd.isnull(labels).any(axis=1)
|
||||
drop_index_labels = (
|
||||
drop_index_labels.replace(True, 1).replace(False, 0).infer_objects(copy=False)
|
||||
|
@ -654,8 +654,8 @@ class FreqaiDataKitchen:
|
|||
pair: str,
|
||||
tf: str,
|
||||
strategy: IStrategy,
|
||||
corr_dataframes: dict = {},
|
||||
base_dataframes: dict = {},
|
||||
corr_dataframes: dict,
|
||||
base_dataframes: dict,
|
||||
is_corr_pairs: bool = False,
|
||||
) -> DataFrame:
|
||||
"""
|
||||
|
@ -776,7 +776,7 @@ class FreqaiDataKitchen:
|
|||
corr_dataframes: dict = {},
|
||||
base_dataframes: dict = {},
|
||||
pair: str = "",
|
||||
prediction_dataframe: DataFrame = pd.DataFrame(),
|
||||
prediction_dataframe: Optional[DataFrame] = None,
|
||||
do_corr_pairs: bool = True,
|
||||
) -> DataFrame:
|
||||
"""
|
||||
|
@ -822,7 +822,7 @@ class FreqaiDataKitchen:
|
|||
if tf not in corr_dataframes[p]:
|
||||
corr_dataframes[p][tf] = pd.DataFrame()
|
||||
|
||||
if not prediction_dataframe.empty:
|
||||
if prediction_dataframe is not None and not prediction_dataframe.empty:
|
||||
dataframe = prediction_dataframe.copy()
|
||||
base_dataframes[self.config["timeframe"]] = dataframe.copy()
|
||||
else:
|
||||
|
|
|
@ -25,7 +25,7 @@ class PyTorchModelTrainer(PyTorchTrainerInterface):
|
|||
criterion: nn.Module,
|
||||
device: str,
|
||||
data_convertor: PyTorchDataConvertor,
|
||||
model_meta_data: Dict[str, Any] = {},
|
||||
model_meta_data: Optional[Dict[str, Any]] = None,
|
||||
window_size: int = 1,
|
||||
tb_logger: Any = None,
|
||||
**kwargs,
|
||||
|
@ -45,6 +45,8 @@ class PyTorchModelTrainer(PyTorchTrainerInterface):
|
|||
:param n_epochs: The maximum number batches to use for evaluation.
|
||||
:param batch_size: The size of the batches to use during training.
|
||||
"""
|
||||
if model_meta_data is None:
|
||||
model_meta_data = {}
|
||||
self.model = model
|
||||
self.optimizer = optimizer
|
||||
self.criterion = criterion
|
||||
|
|
|
@ -168,8 +168,6 @@ max-complexity = 12
|
|||
[tool.ruff.lint.per-file-ignores]
|
||||
"freqtrade/freqai/**/*.py" = [
|
||||
"S311", # Standard pseudo-random generators are not suitable for cryptographic purposes
|
||||
"B006", # Bugbear - mutable default argument
|
||||
"B008", # bugbear - Do not perform function calls in argument defaults
|
||||
]
|
||||
"tests/**/*.py" = [
|
||||
"S101", # allow assert in tests
|
||||
|
|
|
@ -7,10 +7,10 @@
|
|||
-r docs/requirements-docs.txt
|
||||
|
||||
coveralls==4.0.1
|
||||
ruff==0.6.4
|
||||
ruff==0.6.5
|
||||
mypy==1.11.2
|
||||
pre-commit==3.8.0
|
||||
pytest==8.3.2
|
||||
pytest==8.3.3
|
||||
pytest-asyncio==0.24.0
|
||||
pytest-cov==5.0.0
|
||||
pytest-mock==3.14.0
|
||||
|
@ -27,6 +27,6 @@ nbconvert==7.16.4
|
|||
# mypy types
|
||||
types-cachetools==5.5.0.20240820
|
||||
types-filelock==3.2.7
|
||||
types-requests==2.32.0.20240907
|
||||
types-requests==2.32.0.20240914
|
||||
types-tabulate==0.9.0.20240106
|
||||
types-python-dateutil==2.9.0.20240906
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
-r requirements-plot.txt
|
||||
|
||||
# Required for freqai
|
||||
scikit-learn==1.5.1
|
||||
scikit-learn==1.5.2
|
||||
joblib==1.4.2
|
||||
catboost==1.2.7; 'arm' not in platform_machine
|
||||
# Pin Matplotlib - it's depended on by catboost
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
# Required for hyperopt
|
||||
scipy==1.14.1; python_version >= "3.10"
|
||||
scipy==1.13.1; python_version < "3.10"
|
||||
scikit-learn==1.5.1
|
||||
scikit-learn==1.5.2
|
||||
ft-scikit-optimize==0.9.2
|
||||
filelock==3.16.0
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Include all requirements to run the bot.
|
||||
-r requirements.txt
|
||||
|
||||
plotly==5.24.0
|
||||
plotly==5.24.1
|
||||
|
|
|
@ -4,7 +4,7 @@ bottleneck==1.4.0
|
|||
numexpr==2.10.1
|
||||
pandas-ta==0.3.14b
|
||||
|
||||
ccxt==4.3.98
|
||||
ccxt==4.4.3
|
||||
cryptography==42.0.8; platform_machine == 'armv7l'
|
||||
cryptography==43.0.1; platform_machine != 'armv7l'
|
||||
aiohttp==3.10.5
|
||||
|
@ -15,7 +15,7 @@ httpx>=0.24.1
|
|||
humanize==4.10.0
|
||||
cachetools==5.5.0
|
||||
requests==2.32.3
|
||||
urllib3==2.2.2
|
||||
urllib3==2.2.3
|
||||
jsonschema==4.23.0
|
||||
TA-Lib==0.4.32
|
||||
technical==1.4.4
|
||||
|
@ -26,7 +26,7 @@ jinja2==3.1.4
|
|||
tables==3.9.1; python_version < "3.10"
|
||||
tables==3.10.1; python_version >= "3.10"
|
||||
joblib==1.4.2
|
||||
rich==13.8.0
|
||||
rich==13.8.1
|
||||
pyarrow==17.0.0; platform_machine != 'armv7l'
|
||||
|
||||
# find first, C search in arrays
|
||||
|
@ -41,8 +41,8 @@ orjson==3.10.7
|
|||
sdnotify==0.3.2
|
||||
|
||||
# API Server
|
||||
fastapi==0.114.0
|
||||
pydantic==2.9.0
|
||||
fastapi==0.114.2
|
||||
pydantic==2.9.1
|
||||
uvicorn==0.30.6
|
||||
pyjwt==2.9.0
|
||||
aiofiles==24.1.0
|
||||
|
@ -53,7 +53,7 @@ questionary==2.0.1
|
|||
prompt-toolkit==3.0.36
|
||||
# Extensions to datetime library
|
||||
python-dateutil==2.9.0.post0
|
||||
pytz==2024.1
|
||||
pytz==2024.2
|
||||
|
||||
#Futures
|
||||
schedule==1.2.2
|
||||
|
|
|
@ -151,7 +151,9 @@ def test_get_pair_data_for_features_with_prealoaded_data(mocker, freqai_conf):
|
|||
freqai.dd.load_all_pair_histories(timerange, freqai.dk)
|
||||
|
||||
_, base_df = freqai.dd.get_base_and_corr_dataframes(timerange, "LTC/BTC", freqai.dk)
|
||||
df = freqai.dk.get_pair_data_for_features("LTC/BTC", "5m", strategy, base_dataframes=base_df)
|
||||
df = freqai.dk.get_pair_data_for_features(
|
||||
"LTC/BTC", "5m", strategy, {}, base_dataframes=base_df
|
||||
)
|
||||
|
||||
assert df is base_df["5m"]
|
||||
assert not df.empty
|
||||
|
@ -171,7 +173,9 @@ def test_get_pair_data_for_features_without_preloaded_data(mocker, freqai_conf):
|
|||
freqai.dd.load_all_pair_histories(timerange, freqai.dk)
|
||||
|
||||
base_df = {"5m": pd.DataFrame()}
|
||||
df = freqai.dk.get_pair_data_for_features("LTC/BTC", "5m", strategy, base_dataframes=base_df)
|
||||
df = freqai.dk.get_pair_data_for_features(
|
||||
"LTC/BTC", "5m", strategy, {}, base_dataframes=base_df
|
||||
)
|
||||
|
||||
assert df is not base_df["5m"]
|
||||
assert not df.empty
|
||||
|
|
Loading…
Reference in New Issue
Block a user