Merge branch 'freqtrade:develop' into develop
This commit is contained in:
commit
8b6d70c65d
@ -11,7 +11,7 @@ Per default, the bot loads the configuration from the `config.json` file, locate
|
|||||||
|
|
||||||
You can specify a different configuration file used by the bot with the `-c/--config` command-line option.
|
You can specify a different configuration file used by the bot with the `-c/--config` command-line option.
|
||||||
|
|
||||||
If you used the [Quick start](installation.md/#quick-start) method for installing
|
If you used the [Quick start](docker_quickstart.md#docker-quick-start) method for installing
|
||||||
the bot, the installation script should have already created the default configuration file (`config.json`) for you.
|
the bot, the installation script should have already created the default configuration file (`config.json`) for you.
|
||||||
|
|
||||||
If the default configuration file is not created we recommend to use `freqtrade new-config --config config.json` to generate a basic configuration file.
|
If the default configuration file is not created we recommend to use `freqtrade new-config --config config.json` to generate a basic configuration file.
|
||||||
|
@ -58,11 +58,12 @@ where `ReinforcementLearner` will use the templated `ReinforcementLearner` from
|
|||||||
Most of the function remains the same as for typical Regressors, however, the function above shows how the strategy must pass the raw price data to the agent so that it has access to raw OHLCV in the training environment:
|
Most of the function remains the same as for typical Regressors, however, the function above shows how the strategy must pass the raw price data to the agent so that it has access to raw OHLCV in the training environment:
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
def feature_engineering_standard():
|
||||||
# The following features are necessary for RL models
|
# The following features are necessary for RL models
|
||||||
informative[f"%-{pair}raw_close"] = informative["close"]
|
informative[f"%-raw_close"] = informative["close"]
|
||||||
informative[f"%-{pair}raw_open"] = informative["open"]
|
informative[f"%-raw_open"] = informative["open"]
|
||||||
informative[f"%-{pair}raw_high"] = informative["high"]
|
informative[f"%-raw_high"] = informative["high"]
|
||||||
informative[f"%-{pair}raw_low"] = informative["low"]
|
informative[f"%-raw_low"] = informative["low"]
|
||||||
```
|
```
|
||||||
|
|
||||||
Finally, there is no explicit "label" to make - instead it is necessary to assign the `&-action` column which will contain the agent's actions when accessed in `populate_entry/exit_trends()`. In the present example, the neutral action to 0. This value should align with the environment used. FreqAI provides two environments, both use 0 as the neutral action.
|
Finally, there is no explicit "label" to make - instead it is necessary to assign the `&-action` column which will contain the agent's actions when accessed in `populate_entry/exit_trends()`. In the present example, the neutral action to 0. This value should align with the environment used. FreqAI provides two environments, both use 0 as the neutral action.
|
||||||
|
@ -2,18 +2,19 @@
|
|||||||
__version__ = '2023.1.dev'
|
__version__ = '2023.1.dev'
|
||||||
|
|
||||||
if 'dev' in __version__:
|
if 'dev' in __version__:
|
||||||
|
from pathlib import Path
|
||||||
try:
|
try:
|
||||||
import subprocess
|
import subprocess
|
||||||
|
freqtrade_basedir = Path(__file__).parent
|
||||||
|
|
||||||
__version__ = __version__ + '-' + subprocess.check_output(
|
__version__ = __version__ + '-' + subprocess.check_output(
|
||||||
['git', 'log', '--format="%h"', '-n 1'],
|
['git', 'log', '--format="%h"', '-n 1'],
|
||||||
stderr=subprocess.DEVNULL).decode("utf-8").rstrip().strip('"')
|
stderr=subprocess.DEVNULL, cwd=freqtrade_basedir).decode("utf-8").rstrip().strip('"')
|
||||||
|
|
||||||
except Exception: # pragma: no cover
|
except Exception: # pragma: no cover
|
||||||
# git not available, ignore
|
# git not available, ignore
|
||||||
try:
|
try:
|
||||||
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
# Try Fallback to freqtrade_commit file (created by CI while building docker image)
|
||||||
from pathlib import Path
|
|
||||||
versionfile = Path('./freqtrade_commit')
|
versionfile = Path('./freqtrade_commit')
|
||||||
if versionfile.is_file():
|
if versionfile.is_file():
|
||||||
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
__version__ = f"docker-{__version__}-{versionfile.read_text()[:8]}"
|
||||||
|
@ -269,6 +269,8 @@ def dataframe_to_json(dataframe: pd.DataFrame) -> str:
|
|||||||
def default(z):
|
def default(z):
|
||||||
if isinstance(z, pd.Timestamp):
|
if isinstance(z, pd.Timestamp):
|
||||||
return z.timestamp() * 1e3
|
return z.timestamp() * 1e3
|
||||||
|
if z is pd.NaT:
|
||||||
|
return 'NaT'
|
||||||
raise TypeError
|
raise TypeError
|
||||||
|
|
||||||
return str(orjson.dumps(dataframe.to_dict(orient='split'), default=default), 'utf-8')
|
return str(orjson.dumps(dataframe.to_dict(orient='split'), default=default), 'utf-8')
|
||||||
|
@ -77,8 +77,8 @@ EXCHANGES = {
|
|||||||
'leverage_in_spot_market': True,
|
'leverage_in_spot_market': True,
|
||||||
},
|
},
|
||||||
'huobi': {
|
'huobi': {
|
||||||
'pair': 'BTC/USDT',
|
'pair': 'ETH/BTC',
|
||||||
'stake_currency': 'USDT',
|
'stake_currency': 'BTC',
|
||||||
'hasQuoteVolume': True,
|
'hasQuoteVolume': True,
|
||||||
'timeframe': '5m',
|
'timeframe': '5m',
|
||||||
'futures': False,
|
'futures': False,
|
||||||
|
@ -5,6 +5,7 @@ from copy import deepcopy
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
import pandas as pd
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.misc import (dataframe_to_json, decimals_per_coin, deep_merge_dicts, file_dump_json,
|
from freqtrade.misc import (dataframe_to_json, decimals_per_coin, deep_merge_dicts, file_dump_json,
|
||||||
@ -231,3 +232,7 @@ def test_dataframe_json(ohlcv_history):
|
|||||||
assert len(ohlcv_history) == len(dataframe)
|
assert len(ohlcv_history) == len(dataframe)
|
||||||
|
|
||||||
assert_frame_equal(ohlcv_history, dataframe)
|
assert_frame_equal(ohlcv_history, dataframe)
|
||||||
|
ohlcv_history.at[1, 'date'] = pd.NaT
|
||||||
|
json = dataframe_to_json(ohlcv_history)
|
||||||
|
|
||||||
|
dataframe = json_to_dataframe(json)
|
||||||
|
Loading…
Reference in New Issue
Block a user