diff --git a/.gitignore b/.gitignore index 8c7a6e257..c1bb0be68 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,5 @@ target/ .venv .idea .vscode + +.pytest_cache/ diff --git a/Dockerfile b/Dockerfile index a0dafe69a..918552526 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ -FROM python:3.6.2 +FROM python:3.6.4-slim-stretch # Install TA-lib -RUN apt-get update && apt-get -y install build-essential && apt-get clean +RUN apt-get update && apt-get -y install curl build-essential && apt-get clean RUN curl -L http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz | \ tar xzvf - && \ cd ta-lib && \ diff --git a/README.md b/README.md index cac43731d..1caa34a85 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://travis-ci.org/gcarq/freqtrade.svg?branch=develop)](https://travis-ci.org/gcarq/freqtrade) [![Coverage Status](https://coveralls.io/repos/github/gcarq/freqtrade/badge.svg?branch=develop&service=github)](https://coveralls.io/github/gcarq/freqtrade?branch=develop) +[![Maintainability](https://api.codeclimate.com/v1/badges/5737e6d668200b7518ff/maintainability)](https://codeclimate.com/github/gcarq/freqtrade/maintainability) Simple High frequency trading bot for crypto currencies designed to @@ -104,7 +105,7 @@ vi config.json **3. Build your docker image and run it** ```bash docker build -t freqtrade . -docker run --rm -v `pwd`/config.json:/freqtrade/config.json -it freqtrade +docker run --rm -v /etc/localtime:/etc/localtime:ro -v `pwd`/config.json:/freqtrade/config.json -it freqtrade ``` diff --git a/docs/backtesting.md b/docs/backtesting.md index a704f1cb9..b8da09226 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -53,13 +53,13 @@ python3 ./freqtrade/main.py backtesting --datadir freqtrade/tests/testdata-20180 **With a (custom) strategy file** ```bash -python3.6 ./freqtrade/main.py -s currentstrategy backtesting +python3 ./freqtrade/main.py -s currentstrategy backtesting ``` Where `-s currentstrategy` refers to a filename `currentstrategy.py` in `freqtrade/user_data/strategies` **Exporting trades to file** ```bash -freqtrade backtesting --export trades +python3 ./freqtrade/main.py backtesting --export trades ``` **Running backtest with smaller testset** @@ -99,7 +99,7 @@ cd user_data/data-20180113 Possibly edit pairs.json file to include/exclude pairs ```bash -python freqtrade/tests/testdata/download_backtest_data.py -p pairs.json +python3 freqtrade/tests/testdata/download_backtest_data.py -p pairs.json ``` The script will read your pairs.json file, and download ticker data diff --git a/docs/installation.md b/docs/installation.md index fdd572824..a7e61bbe5 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -129,7 +129,7 @@ docker images You can run a one-off container that is immediately deleted upon exiting with the following command (`config.json` must be in the current working directory): ```bash -docker run --rm -v `pwd`/config.json:/freqtrade/config.json -it freqtrade +docker run --rm -v /etc/localtime:/etc/localtime:ro -v `pwd`/config.json:/freqtrade/config.json -it freqtrade ``` In this example, the database will be created inside the docker instance and will be lost when you will refresh your image. @@ -152,6 +152,7 @@ mv tradesv3.sqlite ~/.freqtrade ```bash docker run -d \ --name freqtrade \ + -v /etc/localtime:/etc/localtime:ro \ -v ~/.freqtrade/config.json:/freqtrade/config.json \ -v ~/.freqtrade/tradesv3.sqlite:/freqtrade/tradesv3.sqlite \ freqtrade diff --git a/docs/plotting.md b/docs/plotting.md index bbbe0fe16..80ab6866e 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -73,5 +73,5 @@ The `-p` pair argument, can be used to plot a single pair Example ``` -python3.6 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p BTC_LTC +python3 scripts/plot_profit.py --datadir ../freqtrade/freqtrade/tests/testdata-20171221/ -p BTC_LTC ``` diff --git a/docs/pre-requisite.md b/docs/pre-requisite.md index 931d12d38..79232a89d 100644 --- a/docs/pre-requisite.md +++ b/docs/pre-requisite.md @@ -15,7 +15,7 @@ The only things you need is a working Telegram bot and its API token. Below we explain how to create your Telegram Bot, and how to get your Telegram user id. -### 1. Create your instagram bot +### 1. Create your Telegram bot **1.1. Start a chat with https://telegram.me/BotFather** **1.2. Send the message** `/newbot` *BotFather response:* diff --git a/freqtrade/tests/optimize/test_hyperopt.py b/freqtrade/tests/optimize/test_hyperopt.py index 047c42972..f29694c2f 100644 --- a/freqtrade/tests/optimize/test_hyperopt.py +++ b/freqtrade/tests/optimize/test_hyperopt.py @@ -79,6 +79,7 @@ def test_loss_calculation_prefer_correct_trade_count() -> None: Test Hyperopt.calculate_loss() """ hyperopt = _HYPEROPT + Strategy({'strategy': 'default_strategy'}) correct = hyperopt.calculate_loss(1, hyperopt.target_trades, 20) over = hyperopt.calculate_loss(1, hyperopt.target_trades + 100, 20) @@ -169,10 +170,10 @@ def test_fmin_best_results(mocker, default_conf, caplog) -> None: mocker.patch('freqtrade.optimize.hyperopt.hyperopt_optimize_conf', return_value=conf) mocker.patch('freqtrade.logger.Logger.set_format', MagicMock()) + Strategy({'strategy': 'default_strategy'}) hyperopt = Hyperopt(conf) hyperopt.trials = create_trials(mocker) hyperopt.tickerdata_to_dataframe = MagicMock() - Strategy({'strategy': 'default_strategy'}) hyperopt.start() exists = [ diff --git a/requirements.txt b/requirements.txt index 646e8b8ca..29361ecdb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ python-bittrex==0.3.0 -SQLAlchemy==1.2.4 -python-telegram-bot==9.0.0 +SQLAlchemy==1.2.5 +python-telegram-bot==10.0.1 arrow==0.12.1 cachetools==2.0.1 requests==2.18.4 @@ -10,8 +10,8 @@ pandas==0.22.0 scikit-learn==0.19.1 scipy==1.0.0 jsonschema==2.6.0 -numpy==1.14.1 -TA-Lib==0.4.16 +numpy==1.14.2 +TA-Lib==0.4.17 pytest==3.4.2 pytest-mock==1.7.1 pytest-cov==2.5.1