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: diff --git a/docs/installation.md b/docs/installation.md index e5f514eb1..80223f954 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/Mac/Windows with WSL ```bash git clone https://github.com/freqtrade/freqtrade.git ``` +Windows with docker +```bash +git clone --config core.autocrlf=input https://github.com/freqtrade/freqtrade.git +``` + **1.2. (Optional) Checkout the develop branch** ```bash 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}, diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index 2b6d13fcf..25d3e62c0 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -160,7 +160,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: @@ -547,14 +546,10 @@ 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 - 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) @@ -578,6 +573,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]: diff --git a/requirements-dev.txt b/requirements-dev.txt index 1bbf5cbe1..34d59d802 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,12 +1,12 @@ # 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 +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 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