Merge branch 'develop' into pr/iuvbio/1563

This commit is contained in:
Matthias 2019-02-21 06:29:37 +01:00
commit 2dcb4134cc
6 changed files with 23 additions and 13 deletions

View File

@ -27,7 +27,6 @@ jobs:
- stage: tests - stage: tests
script: script:
- pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/ - pytest --cov=freqtrade --cov-config=.coveragerc freqtrade/tests/
- coveralls
name: pytest name: pytest
- script: - script:
- cp config.json.example config.json - cp config.json.example config.json
@ -48,6 +47,8 @@ jobs:
- build_helpers/publish_docker.sh - build_helpers/publish_docker.sh
name: "Build and test and push docker image" name: "Build and test and push docker image"
after_success:
- coveralls
notifications: notifications:
slack: slack:

View File

@ -115,10 +115,16 @@ Once you have Docker installed, simply create the config file (e.g. `config.json
**1.1. Clone the git repository** **1.1. Clone the git repository**
Linux/Mac/Windows with WSL
```bash ```bash
git clone https://github.com/freqtrade/freqtrade.git 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** **1.2. (Optional) Checkout the develop branch**
```bash ```bash

View File

@ -67,6 +67,7 @@ CONF_SCHEMA = {
}, },
'minProperties': 1 'minProperties': 1
}, },
'amount_reserve_percent': {'type': 'number', 'minimum': 0.0, 'maximum': 0.5},
'stoploss': {'type': 'number', 'maximum': 0, 'exclusiveMaximum': True}, 'stoploss': {'type': 'number', 'maximum': 0, 'exclusiveMaximum': True},
'trailing_stop': {'type': 'boolean'}, 'trailing_stop': {'type': 'boolean'},
'trailing_stop_positive': {'type': 'number', 'minimum': 0, 'maximum': 1}, 'trailing_stop_positive': {'type': 'number', 'minimum': 0, 'maximum': 1},

View File

@ -160,7 +160,6 @@ class Exchange(object):
return self._api.id return self._api.id
def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame: def klines(self, pair_interval: Tuple[str, str], copy=True) -> DataFrame:
# create key tuple
if pair_interval in self._klines: if pair_interval in self._klines:
return self._klines[pair_interval].copy() if copy else self._klines[pair_interval] return self._klines[pair_interval].copy() if copy else self._klines[pair_interval]
else: else:
@ -547,14 +546,10 @@ class Exchange(object):
input_coroutines = [] input_coroutines = []
# Gather corotines to run # Gather coroutines to run
for pair, ticker_interval in set(pair_list): for pair, ticker_interval in set(pair_list):
# Calculating ticker interval in second if (not ((pair, ticker_interval) in self._klines)
interval_in_sec = constants.TICKER_INTERVAL_MINUTES[ticker_interval] * 60 or self._now_is_time_to_refresh(pair, ticker_interval)):
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):
input_coroutines.append(self._async_get_candle_history(pair, ticker_interval)) input_coroutines.append(self._async_get_candle_history(pair, ticker_interval))
else: else:
logger.debug("Using cached ohlcv data for %s, %s ...", pair, ticker_interval) 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) ticks, tick_interval, fill_missing=True)
return tickers 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 @retrier_async
async def _async_get_candle_history(self, pair: str, tick_interval: str, async def _async_get_candle_history(self, pair: str, tick_interval: str,
since_ms: Optional[int] = None) -> Tuple[str, str, List]: since_ms: Optional[int] = None) -> Tuple[str, str, List]:

View File

@ -1,12 +1,12 @@
# Include all requirements to run the bot. # Include all requirements to run the bot.
-r requirements.txt -r requirements.txt
flake8==3.7.5 flake8==3.7.6
flake8-type-annotations==0.1.0 flake8-type-annotations==0.1.0
flake8-tidy-imports==2.0.0 flake8-tidy-imports==2.0.0
pytest==4.2.1 pytest==4.3.0
pytest-mock==1.10.1 pytest-mock==1.10.1
pytest-asyncio==0.10.0 pytest-asyncio==0.10.0
pytest-cov==2.6.1 pytest-cov==2.6.1
coveralls==1.5.1 coveralls==1.6.0
mypy==0.670 mypy==0.670

View File

@ -1,4 +1,4 @@
ccxt==1.18.247 ccxt==1.18.270
SQLAlchemy==1.2.18 SQLAlchemy==1.2.18
python-telegram-bot==11.1.0 python-telegram-bot==11.1.0
arrow==0.13.1 arrow==0.13.1