From dffb27326e8fd3dcfab49df3ae3f25de30e15500 Mon Sep 17 00:00:00 2001 From: gautier pialat Date: Mon, 18 Feb 2019 17:16:27 +0100 Subject: [PATCH 01/11] prevent convert LF->CRLF line ending on window During docker built on windows if in global git config core.autocrlf = true then when have this message : Step 6/12 : RUN cd /tmp && /tmp/install_ta-lib.sh && rm -r /tmp/*ta-lib* ---> Running in c0a626821132 /tmp/install_ta-lib.sh: 4: /tmp/install_ta-lib.sh: Syntax error: "&&" unexpected this behave is because file is in the wrong line ending format Has script files run on linux they need to use LF lines ending so we need to ensure they are not converted to CRLF lines ending if global git config is at core.autocrlf = true. --- docs/installation.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/installation.md b/docs/installation.md index e5f514eb1..08592880f 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -115,10 +115,16 @@ Once you have Docker installed, simply create the config file (e.g. `config.json **1.1. Clone the git repository** +Linux ```bash git clone https://github.com/freqtrade/freqtrade.git ``` +Windows (docker or WSL) +```bash +git clone --config core.autocrlf=input https://github.com/freqtrade/freqtrade.git +``` + **1.2. (Optional) Checkout the develop branch** ```bash From 58864adc4a51b49bd2818955c6ece65e00b16d5c Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 19 Feb 2019 19:54:53 +0100 Subject: [PATCH 02/11] Move coveralls to after_success --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3dfcf6111..84f3c78d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,7 +27,6 @@ jobs: - stage: tests script: - pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/ - - coveralls name: pytest - script: - cp config.json.example config.json @@ -48,6 +47,8 @@ jobs: - build_helpers/publish_docker.sh name: "Build and test and push docker image" +after_success: + - coveralls notifications: slack: From bd6644a91a5a049bc0a31cebb70eeb5c8d940801 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Feb 2019 13:31:05 +0100 Subject: [PATCH 03/11] Update ccxt from 1.18.247 to 1.18.270 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c9cedcb0c..b4dd302e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -ccxt==1.18.247 +ccxt==1.18.270 SQLAlchemy==1.2.18 python-telegram-bot==11.1.0 arrow==0.13.1 From 1cd54829cc22c54d8344b2585016a476da21cf22 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Feb 2019 13:31:06 +0100 Subject: [PATCH 04/11] Update flake8 from 3.7.5 to 3.7.6 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 1bbf5cbe1..9fbc99d16 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ # Include all requirements to run the bot. -r requirements.txt -flake8==3.7.5 +flake8==3.7.6 flake8-type-annotations==0.1.0 flake8-tidy-imports==2.0.0 pytest==4.2.1 From 3ec3438acfe1a5e1e9e63dcec098b0cb3e18efb0 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Feb 2019 13:31:07 +0100 Subject: [PATCH 05/11] Update pytest from 4.2.1 to 4.3.0 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9fbc99d16..9aa755827 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,7 +4,7 @@ flake8==3.7.6 flake8-type-annotations==0.1.0 flake8-tidy-imports==2.0.0 -pytest==4.2.1 +pytest==4.3.0 pytest-mock==1.10.1 pytest-asyncio==0.10.0 pytest-cov==2.6.1 From 7dbb7a52edaebd651ec43127c466f449f4a7ab55 Mon Sep 17 00:00:00 2001 From: pyup-bot Date: Wed, 20 Feb 2019 13:31:08 +0100 Subject: [PATCH 06/11] Update coveralls from 1.5.1 to 1.6.0 --- requirements-dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 9aa755827..34d59d802 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -8,5 +8,5 @@ pytest==4.3.0 pytest-mock==1.10.1 pytest-asyncio==0.10.0 pytest-cov==2.6.1 -coveralls==1.5.1 +coveralls==1.6.0 mypy==0.670 From ba23f58ff30aba7c1f5b5919bf24b45493b1fe5b Mon Sep 17 00:00:00 2001 From: gautier pialat Date: Wed, 20 Feb 2019 18:09:26 +0100 Subject: [PATCH 07/11] change the way to clone git rep for Window with docker --- docs/installation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/installation.md b/docs/installation.md index 08592880f..80223f954 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -115,12 +115,12 @@ Once you have Docker installed, simply create the config file (e.g. `config.json **1.1. Clone the git repository** -Linux +Linux/Mac/Windows with WSL ```bash git clone https://github.com/freqtrade/freqtrade.git ``` -Windows (docker or WSL) +Windows with docker ```bash git clone --config core.autocrlf=input https://github.com/freqtrade/freqtrade.git ``` From eb211706913b12fd5845ae5c606dc23adefbc0b4 Mon Sep 17 00:00:00 2001 From: hroff-1902 <47309513+hroff-1902@users.noreply.github.com> Date: Thu, 21 Feb 2019 00:26:02 +0300 Subject: [PATCH 08/11] added amount_reserve_percent into config json-schema --- freqtrade/constants.py | 1 + 1 file changed, 1 insertion(+) diff --git a/freqtrade/constants.py b/freqtrade/constants.py index 6c71ddf7b..ff250c1f1 100644 --- a/freqtrade/constants.py +++ b/freqtrade/constants.py @@ -67,6 +67,7 @@ CONF_SCHEMA = { }, 'minProperties': 1 }, + 'amount_reserve_percent': {'type': 'number', 'minimum': 0.0, 'maximum': 0.5}, 'stoploss': {'type': 'number', 'maximum': 0, 'exclusiveMaximum': True}, 'trailing_stop': {'type': 'boolean'}, 'trailing_stop_positive': {'type': 'number', 'minimum': 0, 'maximum': 1}, From 2aba9c081cd9a5a38de6f5e523a1bbcd322fca76 Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Thu, 21 Feb 2019 00:46:35 +0300 Subject: [PATCH 09/11] fixed typos in comments --- freqtrade/exchange/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 47886989e..d05436a36 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -540,9 +540,9 @@ class Exchange(object): input_coroutines = [] - # Gather corotines to run + # Gather coroutines to run for pair, ticker_interval in set(pair_list): - # Calculating ticker interval in second + # Calculating ticker interval in seconds interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60 if not ((self._pairs_last_refresh_time.get((pair, ticker_interval), 0) From c1ef6940b094958efc52ca5807fc39354caaff2c Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Thu, 21 Feb 2019 00:47:18 +0300 Subject: [PATCH 10/11] removed wrong comment: tuple is not created here --- freqtrade/exchange/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index d05436a36..c53858076 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -159,7 +159,6 @@ class Exchange(object): return self._api.id def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame: - # create key tuple if pair_interval in self._klines: return self._klines[pair_interval].copy() if copy else self._klines[pair_interval] else: From 285183372650e27490bb67dd5e519c487f23f48b Mon Sep 17 00:00:00 2001 From: hroff-1902 Date: Thu, 21 Feb 2019 01:20:24 +0300 Subject: [PATCH 11/11] added _now_is_time_to_refresh() --- freqtrade/exchange/__init__.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index c53858076..145e802fa 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -541,12 +541,8 @@ class Exchange(object): # Gather coroutines to run for pair, ticker_interval in set(pair_list): - # Calculating ticker interval in seconds - interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60 - - if not ((self._pairs_last_refresh_time.get((pair, ticker_interval), 0) - + interval_in_sec) >= arrow.utcnow().timestamp - and (pair, ticker_interval) in self._klines): + if not ((pair, ticker_interval) in self._klines) \ + or self._now_is_time_to_refresh(pair, ticker_interval): input_coroutines.append(self._async_get_candle_history(pair, ticker_interval)) else: logger.debug("Using cached ohlcv data for %s, %s ...", pair, ticker_interval) @@ -570,6 +566,13 @@ class Exchange(object): ticks, tick_interval, fill_missing=True) return tickers + def _now_is_time_to_refresh(self, pair: str, ticker_interval: str) -> bool: + # Calculating ticker interval in seconds + interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60 + + return not ((self._pairs_last_refresh_time.get((pair, ticker_interval), 0) + + interval_in_sec) >= arrow.utcnow().timestamp) + @retrier_async async def _async_get_candle_history(self, pair: str, tick_interval: str, since_ms: Optional[int] = None) -> Tuple[str, str, List]: