diff --git a/docs/backtesting.md b/docs/backtesting.md index cc8ecd6c7..0a60d2db3 100644 --- a/docs/backtesting.md +++ b/docs/backtesting.md @@ -1,24 +1,19 @@ # Backtesting -This page explains how to validate your strategy performance by using +This page explains how to validate your strategy performance by using Backtesting. -## Table of Contents - -- [Test your strategy with Backtesting](#test-your-strategy-with-backtesting) -- [Understand the backtesting result](#understand-the-backtesting-result) - ## Test your strategy with Backtesting Now you have good Buy and Sell strategies, you want to test it against -real data. This is what we call +real data. This is what we call [backtesting](https://en.wikipedia.org/wiki/Backtesting). Backtesting will use the crypto-currencies (pair) from your config file -and load static tickers located in -[/freqtrade/tests/testdata](https://github.com/freqtrade/freqtrade/tree/develop/freqtrade/tests/testdata). -If the 5 min and 1 min ticker for the crypto-currencies to test is not -already in the `testdata` folder, backtesting will download them +and load static tickers located in +[/freqtrade/tests/testdata](https://github.com/freqtrade/freqtrade/tree/develop/freqtrade/tests/testdata). +If the 5 min and 1 min ticker for the crypto-currencies to test is not +already in the `testdata` folder, backtesting will download them automatically. Testdata files will not be updated until you specify it. The result of backtesting will confirm you if your bot has better odds of making a profit than a loss. @@ -205,7 +200,7 @@ A backtesting result will look like that: The 1st table will contain all trades the bot made. -The 2nd table will contain all trades the bot had to `forcesell` at the end of the backtest period to prsent a full picture. +The 2nd table will contain all trades the bot had to `forcesell` at the end of the backtest period to present a full picture. These trades are also included in the first table, but are extracted separately for clarity. The last line will give you the overall performance of your strategy, @@ -216,15 +211,15 @@ TOTAL 419 -0.41 -0.00348593 52.9 ``` We understand the bot has made `419` trades for an average duration of -`52.9` min, with a performance of `-0.41%` (loss), that means it has +`52.9` min, with a performance of `-0.41%` (loss), that means it has lost a total of `-0.00348593 BTC`. - -As you will see your strategy performance will be influenced by your buy -strategy, your sell strategy, and also by the `minimal_roi` and -`stop_loss` you have set. + +As you will see your strategy performance will be influenced by your buy +strategy, your sell strategy, and also by the `minimal_roi` and +`stop_loss` you have set. As for an example if your minimal_roi is only `"0": 0.01`. You cannot -expect the bot to make more profit than 1% (because it will sell every +expect the bot to make more profit than 1% (because it will sell every time a trade will reach 1%). ```json @@ -234,21 +229,21 @@ time a trade will reach 1%). ``` On the other hand, if you set a too high `minimal_roi` like `"0": 0.55` -(55%), there is a lot of chance that the bot will never reach this -profit. Hence, keep in mind that your performance is a mix of your +(55%), there is a lot of chance that the bot will never reach this +profit. Hence, keep in mind that your performance is a mix of your strategies, your configuration, and the crypto-currency you have set up. ## Backtesting multiple strategies To backtest multiple strategies, a list of Strategies can be provided. -This is limited to 1 ticker-interval per run, however, data is only loaded once from disk so if you have multiple +This is limited to 1 ticker-interval per run, however, data is only loaded once from disk so if you have multiple strategies you'd like to compare, this should give a nice runtime boost. All listed Strategies need to be in the same folder. ``` bash -freqtrade backtesting --timerange 20180401-20180410 --ticker-interval 5m --strategy-list Strategy001 Strategy002 --export trades +freqtrade backtesting --timerange 20180401-20180410 --ticker-interval 5m --strategy-list Strategy001 Strategy002 --export trades ``` This will save the results to `user_data/backtest_data/backtest-result-.json`, injecting the strategy-name into the target filename. @@ -266,5 +261,5 @@ Detailed output for all strategies one after the other will be available, so mak ## Next step Great, your strategy is profitable. What if the bot can give your the -optimal parameters to use for your strategy? -Your next step is to learn [how to find optimal parameters with Hyperopt](https://github.com/freqtrade/freqtrade/blob/develop/docs/hyperopt.md) +optimal parameters to use for your strategy? +Your next step is to learn [how to find optimal parameters with Hyperopt](hyperopt.md) diff --git a/docs/bot-optimization.md b/docs/bot-optimization.md index 0fc41a2e3..4ff0c6f24 100644 --- a/docs/bot-optimization.md +++ b/docs/bot-optimization.md @@ -1,28 +1,8 @@ -# Bot Optimization +# Optimization This page explains where to customize your strategies, and add new indicators. -## Table of Contents - -- [Install a custom strategy file](#install-a-custom-strategy-file) -- [Customize your strategy](#change-your-strategy) - - [Anatomy of a strategy](#anatomy-of-a-strategy) - - [Customize indicators](#customize-indicators) - - [Buy signal rules](#buy-signal-rules) - - [Sell signal rules](#sell-signal-rules) - - [Minimal ROI](#minimal-roi) - - [Stoploss](#stoploss) - - [Ticker interval](#ticker-interval) - - [Metadata dict](#metadata-dict) - - [Where is the default strategy](#where-is-the-default-strategy) - - [Specify custom strategy location](#specify-custom-strategy-location) - - [Further strategy ideas](#further-strategy-ideas) - -- [Where is the default strategy](#where-is-the-default-strategy) - -Since the version `0.16.0` the bot allows using custom strategy file. - ## Install a custom strategy file This is very simple. Copy paste your strategy file into the folder @@ -60,7 +40,7 @@ A strategy file contains all the information needed to build a good strategy: The bot also include a sample strategy called `TestStrategy` you can update: `user_data/strategies/test_strategy.py`. You can test it with the parameter: `--strategy TestStrategy` -``` bash +```bash python3 ./freqtrade/main.py --strategy AwesomeStrategy ``` @@ -118,10 +98,10 @@ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame return dataframe ``` -#### Want more indicator examples -Look into the [user_data/strategies/test_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/test_strategy.py). -Then uncomment indicators you need. +!!! Note "Want more indicator examples?" + Look into the [user_data/strategies/test_strategy.py](https://github.com/freqtrade/freqtrade/blob/develop/user_data/strategies/test_strategy.py).
+ Then uncomment indicators you need. ### Buy signal rules @@ -187,7 +167,7 @@ This dict defines the minimal Return On Investment (ROI) a trade should reach be It is of the following format, with the dict key (left side of the colon) being the minutes passed since the trade opened, and the value (right side of the colon) being the percentage. -```python +```python minimal_roi = { "40": 0.0, "30": 0.01, @@ -227,7 +207,7 @@ stoploss = -0.10 ``` This would signify a stoploss of -10%. -If your exchange supports it, it's recommended to also set `"stoploss_on_exchange"` in the order dict, so your stoploss is on the exchange and cannot be missed for network-problems (or other problems). +If your exchange supports it, it's recommended to also set `"stoploss_on_exchange"` in the order dict, so your stoploss is on the exchange and cannot be missed for network-problems (or other problems). For more information on order_types please look [here](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md#understand-order_types). @@ -267,4 +247,4 @@ We also got a *strategy-sharing* channel in our [Slack community](https://join.s ## Next step Now you have a perfect strategy you probably want to backtest it. -Your next step is to learn [How to use the Backtesting](https://github.com/freqtrade/freqtrade/blob/develop/docs/backtesting.md). +Your next step is to learn [How to use the Backtesting](backtesting.md). diff --git a/docs/bot-usage.md b/docs/bot-usage.md index 5451c8459..bc5e7f0b4 100644 --- a/docs/bot-usage.md +++ b/docs/bot-usage.md @@ -1,32 +1,28 @@ -# Bot usage +# Start the bot -This page explains the difference parameters of the bot and how to run it. +This page explains the different parameters of the bot and how to run it. -## Table of Contents - -- [Bot commands](#bot-commands) -- [Backtesting commands](#backtesting-commands) -- [Hyperopt commands](#hyperopt-commands) ## Bot commands ``` -usage: freqtrade [-h] [-v] [--version] [-c PATH] [-d PATH] [-s NAME] - [--strategy-path PATH] [--dynamic-whitelist [INT]] - [--db-url PATH] - {backtesting,hyperopt} ... +usage: main.py [-h] [-v] [--version] [-c PATH] [-d PATH] [-s NAME] + [--strategy-path PATH] [--customhyperopt NAME] + [--dynamic-whitelist [INT]] [--db-url PATH] + {backtesting,edge,hyperopt} ... Simple High Frequency Trading Bot for crypto currencies positional arguments: - {backtesting,hyperopt} + {backtesting,edge,hyperopt} backtesting backtesting module + edge edge module hyperopt hyperopt module optional arguments: -h, --help show this help message and exit - -v, --verbose be verbose - --version show program's version number and exit + -v, --verbose verbose mode (-vv for more, -vvv to get all messages) + --version show program\'s version number and exit -c PATH, --config PATH specify configuration file (default: config.json) -d PATH, --datadir PATH @@ -34,12 +30,15 @@ optional arguments: -s NAME, --strategy NAME specify strategy class name (default: DefaultStrategy) --strategy-path PATH specify additional strategy lookup path + --customhyperopt NAME + specify hyperopt class name (default: + DefaultHyperOpts) --dynamic-whitelist [INT] dynamically generate and update whitelist based on 24h - BaseVolume (default: 20) DEPRECATED + BaseVolume (default: 20) DEPRECATED. --db-url PATH Override trades database URL, this is useful if dry_run is enabled or in custom deployments (default: - sqlite:///tradesv3.sqlite) + None) ``` ### How to use a different config file? @@ -51,7 +50,7 @@ default, the bot will load the file `./config.json` python3 ./freqtrade/main.py -c path/far/far/away/config.json ``` -### How to use --strategy? +### How to use **--strategy**? This parameter will allow you to load your custom strategy class. Per default without `--strategy` or `-s` the bot will load the @@ -74,7 +73,7 @@ message the reason (File not found, or errors in your code). Learn more about strategy file in [optimize your bot](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md). -### How to use --strategy-path? +### How to use **--strategy-path**? This parameter allows you to add an additional strategy lookup path, which gets checked before the default locations (The passed path must be a folder!): @@ -87,9 +86,10 @@ python3 ./freqtrade/main.py --strategy AwesomeStrategy --strategy-path /some/fol This is very simple. Copy paste your strategy file into the folder `user_data/strategies` or use `--strategy-path`. And voila, the bot is ready to use it. -### How to use --dynamic-whitelist? +### How to use **--dynamic-whitelist**? -> Dynamic-whitelist is deprecated. Please move your configurations to the configuration as outlined [here](docs/configuration.md#Dynamic-Pairlists) +!!! danger "DEPRECATED" + Dynamic-whitelist is deprecated. Please move your configurations to the configuration as outlined [here](/configuration/#dynamic-pairlists) Per default `--dynamic-whitelist` will retrieve the 20 currencies based on BaseVolume. This value can be changed when you run the script. @@ -113,7 +113,7 @@ python3 ./freqtrade/main.py --dynamic-whitelist 30 negative value (e.g -2), `--dynamic-whitelist` will use the default value (20). -### How to use --db-url? +### How to use **--db-url**? When you run the bot in Dry-run mode, per default no transactions are stored in a database. If you want to store your bot actions in a DB @@ -129,15 +129,17 @@ python3 ./freqtrade/main.py -c config.json --db-url sqlite:///tradesv3.dry_run.s Backtesting also uses the config specified via `-c/--config`. ``` -usage: freqtrade backtesting [-h] [-i TICKER_INTERVAL] [--eps] [--dmmp] - [--timerange TIMERANGE] [-l] [-r] - [--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]] - [--export EXPORT] [--export-filename PATH] +usage: main.py backtesting [-h] [-i TICKER_INTERVAL] [--timerange TIMERANGE] + [--eps] [--dmmp] [-l] [-r] + [--strategy-list STRATEGY_LIST [STRATEGY_LIST ...]] + [--export EXPORT] [--export-filename PATH] optional arguments: -h, --help show this help message and exit -i TICKER_INTERVAL, --ticker-interval TICKER_INTERVAL specify ticker interval (1m, 5m, 30m, 1h, 1d) + --timerange TIMERANGE + specify what timerange of data to use. --eps, --enable-position-stacking Allow buying the same pair multiple times (position stacking) @@ -145,8 +147,6 @@ optional arguments: Disable applying `max_open_trades` during backtest (same as setting `max_open_trades` to a very high number) - --timerange TIMERANGE - specify what timerange of data to use. -l, --live using live data -r, --refresh-pairs-cached refresh the pairs files in tests/testdata with the @@ -167,18 +167,18 @@ optional arguments: filename=user_data/backtest_data/backtest_today.json (default: user_data/backtest_data/backtest- result.json) - ``` -### How to use --refresh-pairs-cached parameter? +### How to use **--refresh-pairs-cached** parameter? The first time your run Backtesting, it will take the pairs you have set in your config file and download data from Bittrex. If for any reason you want to update your data set, you use `--refresh-pairs-cached` to force Backtesting to update the data it has. -**Use it only if you want to update your data set. You will not be able -to come back to the previous version.** + +!!! Note + Use it only if you want to update your data set. You will not be able to come back to the previous version. To test your strategy with latest data, we recommend continuing using the parameter `-l` or `--live`. @@ -250,4 +250,4 @@ in [misc.py](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/misc. ## Next step The optimal strategy of the bot will change with time depending of the market trends. The next step is to -[optimize your bot](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md). +[optimize your bot](bot-optimization.md). diff --git a/docs/configuration.md b/docs/configuration.md index 6f54cfa8d..eb58e4925 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -2,12 +2,6 @@ This page explains how to configure your `config.json` file. -## Table of Contents - -- [Bot commands](#bot-commands) -- [Backtesting commands](#backtesting-commands) -- [Hyperopt commands](#hyperopt-commands) - ## Setup config.json We recommend to copy and use the `config.json.example` as a template @@ -16,7 +10,7 @@ for your bot configuration. The table below will list all configuration parameters. | Command | Default | Mandatory | Description | -|----------|---------|----------|-------------| +|----------|---------|-----------|-------------| | `max_open_trades` | 3 | Yes | Number of trades open your bot will have. If -1 then it is ignored (i.e. potentially unlimited open trades) | `stake_currency` | BTC | Yes | Crypto-currency used for trading. | `stake_amount` | 0.05 | Yes | Amount of crypto-currency your bot will use for each trade. Per default, the bot will use (0.05 BTC x 3) = 0.15 BTC in total will be always engaged. Set it to 'unlimited' to allow the bot to use all avaliable balance. @@ -63,7 +57,7 @@ The table below will list all configuration parameters. | `webhook.webhookbuy` | false | No | Payload to send on buy. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. | `webhook.webhooksell` | false | No | Payload to send on sell. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. | `webhook.webhookstatus` | false | No | Payload to send on status calls. Only required if `webhook.enabled` is `true`. See the [webhook documentationV](webhook-config.md) for more details. -| `db_url` | `sqlite:///tradesv3.sqlite` | No | Declares database URL to use. NOTE: This defaults to `sqlite://` if `dry_run` is `True`. +| `db_url` | `sqlite:///tradesv3.sqlite`| No | Declares database URL to use. NOTE: This defaults to `sqlite://` if `dry_run` is `True`. | `initial_state` | running | No | Defines the initial application state. More information below. | `forcebuy_enable` | false | No | Enables the RPC Commands to force a buy. More information below. | `strategy` | DefaultStrategy | No | Defines Strategy class to use. @@ -77,8 +71,14 @@ The definition of each config parameters is in [misc.py](https://github.com/freq `stake_amount` is an amount of crypto-currency your bot will use for each trade. The minimal value is 0.0005. If there is not enough crypto-currency in the account an exception is generated. -To allow the bot to trade all the avaliable `stake_currency` in your account set `stake_amount` = `unlimited`. -In this case a trade amount is calclulated as `currency_balanse / (max_open_trades - current_open_trades)`. +To allow the bot to trade all the avaliable `stake_currency` in your account set
+```json +"stake_amount" : "unlimited", +``` +In this case a trade amount is calclulated as:
+```python +currency_balanse / (max_open_trades - current_open_trades) +``` ### Understand minimal_roi @@ -86,7 +86,7 @@ In this case a trade amount is calclulated as `currency_balanse / (max_open_trad in minutes and the value is the minimum ROI in percent. See the example below: -``` +```json "minimal_roi": { "40": 0.0, # Sell after 40 minutes if the profit is not negative "30": 0.01, # Sell after 30 minutes if there is at least 1% profit @@ -150,20 +150,21 @@ This can be set in the configuration or in the strategy. Configuration overwrite If this is configured, all 4 values (`"buy"`, `"sell"`, `"stoploss"`, `"stoploss_on_exchange"`) need to be present, otherwise the bot warn about it and will fail to start. The below is the default which is used if this is not configured in either Strategy or configuration. -``` python - "order_types": { - "buy": "limit", - "sell": "limit", - "stoploss": "market", - "stoploss_on_exchange": False - }, +```python +"order_types": { + "buy": "limit", + "sell": "limit", + "stoploss": "market", + "stoploss_on_exchange": False +}, ``` -**NOTE**: Not all exchanges support "market" orders. -The following message will be shown if your exchange does not support market orders: `"Exchange does not support market orders."` +!!! Note + Not all exchanges support "market" orders. + The following message will be shown if your exchange does not support market orders: `"Exchange does not support market orders."` ### Understand order_time_in_force -Order time in force defines the policy by which the order is executed on the exchange. Three commonly used time in force are:
+`order_time_in_force` defines the policy by which the order is executed on the exchange. Three commonly used time in force are:
**GTC (Goog Till Canceled):** This is most of the time the default time in force. It means the order will remain on exchange till it is canceled by user. It can be fully or partially fulfilled. If partially fulfilled, the remaining will stay on the exchange till cancelled.
**FOK (Full Or Kill):** @@ -174,12 +175,14 @@ It is the same as FOK (above) except it can be partially fulfilled. The remainin `order_time_in_force` contains a dict buy and sell time in force policy. This can be set in the configuration or in the strategy. Configuration overwrites strategy configurations.
possible values are: `gtc` (default), `fok` or `ioc`.
``` python - "order_time_in_force": { - "buy": "gtc", - "sell": "gtc" - }, +"order_time_in_force": { + "buy": "gtc", + "sell": "gtc" +}, ``` -**NOTE**: This is an ongoing work. For now it is supported only for binance and only for buy orders. Please don't change the default value unless you know what you are doing.
+ +!!! Warning + This is an ongoing work. For now it is supported only for binance and only for buy orders. Please don't change the default value unless you know what you are doing. ### What values for exchange.name? @@ -198,9 +201,15 @@ Feel free to test other exchanges and submit your PR to improve the bot. ### What values for fiat_display_currency? `fiat_display_currency` set the base currency to use for the conversion from coin to fiat in Telegram. -The valid values are: "AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR", "USD". -In addition to central bank currencies, a range of cryto currencies are supported. -The valid values are: "BTC", "ETH", "XRP", "LTC", "BCH", "USDT". +The valid values are:
+```json +"AUD", "BRL", "CAD", "CHF", "CLP", "CNY", "CZK", "DKK", "EUR", "GBP", "HKD", "HUF", "IDR", "ILS", "INR", "JPY", "KRW", "MXN", "MYR", "NOK", "NZD", "PHP", "PKR", "PLN", "RUB", "SEK", "SGD", "THB", "TRY", "TWD", "ZAR", "USD" +``` +In addition to FIAT currencies, a range of cryto currencies are supported. +The valid values are: +```json +"BTC", "ETH", "XRP", "LTC", "BCH", "USDT" +``` ## Switch to dry-run mode @@ -209,8 +218,6 @@ behave and how is the performance of your strategy. In Dry-run mode the bot does not engage your money. It only runs a live simulation without creating trades. -### To switch your bot in Dry-run mode: - 1. Edit your `config.json` file 2. Switch dry-run to true and specify db_url for a persistent db @@ -238,9 +245,9 @@ production mode. Dynamic pairlists select pairs for you based on the logic configured. The bot runs against all pairs (with that stake) on the exchange, and a number of assets (`number_assets`) is selected based on the selected criteria. -By *default*, a Static Pairlist is used (configured as `"pair_whitelist"` under the `"exchange"` section of this configuration). +By default, a Static Pairlist is used (configured as `"pair_whitelist"` under the `"exchange"` section of this configuration). -#### Available Pairlist methods +**Available Pairlist methods:** * `"StaticPairList"` * uses configuration from `exchange.pair_whitelist` and `exchange.pair_blacklist` @@ -266,15 +273,15 @@ you run it in production mode. ### To switch your bot in production mode -1. Edit your `config.json` file +**Edit your `config.json` file.** -2. Switch dry-run to false and don't forget to adapt your database URL if set +**Switch dry-run to false and don't forget to adapt your database URL if set:** ```json "dry_run": false, ``` -3. Insert your Exchange API key (change them by fake api keys) +**Insert your Exchange API key (change them by fake api keys):** ```json "exchange": { @@ -285,8 +292,8 @@ you run it in production mode. } ``` - -If you have not your Bittrex API key yet, [see our tutorial](https://github.com/freqtrade/freqtrade/blob/develop/docs/pre-requisite.md). +!!! Note + If you have an exchange API key yet, [see our tutorial](/pre-requisite). ### Using proxy with FreqTrade @@ -337,4 +344,4 @@ Please ensure that 'NameOfStrategy' is identical to the strategy name! ## Next step -Now you have configured your config.json, the next step is to [start your bot](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md). +Now you have configured your config.json, the next step is to [start your bot](bot-usage.md). diff --git a/docs/edge.md b/docs/edge.md index 829910484..61abf354b 100644 --- a/docs/edge.md +++ b/docs/edge.md @@ -2,15 +2,11 @@ This page explains how to use Edge Positioning module in your bot in order to enter into a trade only if the trade has a reasonable win rate and risk reward ratio, and consequently adjust your position size and stoploss. -**NOTICE:** Edge positioning is not compatible with dynamic whitelist. it overrides dynamic whitelist. -**NOTICE2:** Edge won't consider anything else than buy/sell/stoploss signals. So trailing stoploss, ROI, and everything else will be ignored in its calculation. +!!! Warning + Edge positioning is not compatible with dynamic whitelist. it overrides dynamic whitelist. -## Table of Contents - -- [Introduction](#introduction) -- [How does it work?](#how-does-it-work?) -- [Configurations](#configurations) -- [Running Edge independently](#running-edge-independently) +!!! Note + Edge won't consider anything else than buy/sell/stoploss signals. So trailing stoploss, ROI, and everything else will be ignored in its calculation. ## Introduction Trading is all about probability. No one can claim that he has a strategy working all the time. You have to assume that sometimes you lose.

diff --git a/docs/faq.md b/docs/faq.md index 31a302067..4bbf28fe6 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -2,43 +2,43 @@ #### I have waited 5 minutes, why hasn't the bot made any trades yet?! -Depending on the buy strategy, the amount of whitelisted coins, the -situation of the market etc, it can take up to hours to find good entry +Depending on the buy strategy, the amount of whitelisted coins, the +situation of the market etc, it can take up to hours to find good entry position for a trade. Be patient! #### I have made 12 trades already, why is my total profit negative?! -I understand your disappointment but unfortunately 12 trades is just -not enough to say anything. If you run backtesting, you can see that our -current algorithm does leave you on the plus side, but that is after -thousands of trades and even there, you will be left with losses on -specific coins that you have traded tens if not hundreds of times. We -of course constantly aim to improve the bot but it will _always_ be a -gamble, which should leave you with modest wins on monthly basis but +I understand your disappointment but unfortunately 12 trades is just +not enough to say anything. If you run backtesting, you can see that our +current algorithm does leave you on the plus side, but that is after +thousands of trades and even there, you will be left with losses on +specific coins that you have traded tens if not hundreds of times. We +of course constantly aim to improve the bot but it will _always_ be a +gamble, which should leave you with modest wins on monthly basis but you can't say much from few trades. -#### I’d like to change the stake amount. Can I just stop the bot with +#### I’d like to change the stake amount. Can I just stop the bot with /stop and then change the config.json and run it again? -Not quite. Trades are persisted to a database but the configuration is -currently only read when the bot is killed and restarted. `/stop` more +Not quite. Trades are persisted to a database but the configuration is +currently only read when the bot is killed and restarted. `/stop` more like pauses. You can stop your bot, adjust settings and start it again. #### I want to improve the bot with a new strategy -That's great. We have a nice backtesting and hyperoptimizing setup. See -the tutorial [here|Testing-new-strategies-with-Hyperopt](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md#hyperopt-commands). +That's great. We have a nice backtesting and hyperoptimizing setup. See +the tutorial [here|Testing-new-strategies-with-Hyperopt](bot-usage.md#hyperopt-commands). -#### Is there a setting to only SELL the coins being held and not +#### Is there a setting to only SELL the coins being held and not perform anymore BUYS? -You can use the `/forcesell all` command from Telegram. +You can use the `/forcesell all` command from Telegram. ### How many epoch do I need to get a good Hyperopt result? -Per default Hyperopts without `-e` or `--epochs` parameter will only -run 100 epochs, means 100 evals of your triggers, guards, .... Too few -to find a great result (unless if you are very lucky), so you probably -have to run it for 10.000 or more. But it will take an eternity to +Per default Hyperopts without `-e` or `--epochs` parameter will only +run 100 epochs, means 100 evals of your triggers, guards, .... Too few +to find a great result (unless if you are very lucky), so you probably +have to run it for 10.000 or more. But it will take an eternity to compute. We recommend you to run it at least 10.000 epochs: @@ -52,7 +52,7 @@ for i in {1..100}; do python3 ./freqtrade/main.py hyperopt -e 100; done ``` #### Why it is so long to run hyperopt? -Finding a great Hyperopt results takes time. +Finding a great Hyperopt results takes time. If you wonder why it takes a while to find great hyperopt results @@ -60,12 +60,11 @@ This answer was written during the under the release 0.15.1, when we had : - 8 triggers - 9 guards: let's say we evaluate even 10 values from each -- 1 stoploss calculation: let's say we want 10 values from that too to +- 1 stoploss calculation: let's say we want 10 values from that too to be evaluated The following calculation is still very rough and not very precise -but it will give the idea. With only these triggers and guards there is -already 8*10^9*10 evaluations. A roughly total of 80 billion evals. -Did you run 100 000 evals? Congrats, you've done roughly 1 / 100 000 th +but it will give the idea. With only these triggers and guards there is +already 8*10^9*10 evaluations. A roughly total of 80 billion evals. +Did you run 100 000 evals? Congrats, you've done roughly 1 / 100 000 th of the search space. - diff --git a/docs/hyperopt.md b/docs/hyperopt.md index dffe84d1d..58dc91e3a 100644 --- a/docs/hyperopt.md +++ b/docs/hyperopt.md @@ -1,64 +1,56 @@ # Hyperopt -This page explains how to tune your strategy by finding the optimal -parameters, a process called hyperparameter optimization. The bot uses several +This page explains how to tune your strategy by finding the optimal +parameters, a process called hyperparameter optimization. The bot uses several algorithms included in the `scikit-optimize` package to accomplish this. The search will burn all your CPU cores, make your laptop sound like a fighter jet and still take a long time. -*Note:* Hyperopt will crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133) - -## Table of Contents - -- [Prepare your Hyperopt](#prepare-hyperopt) -- [Configure your Guards and Triggers](#configure-your-guards-and-triggers) -- [Solving a Mystery](#solving-a-mystery) -- [Adding New Indicators](#adding-new-indicators) -- [Execute Hyperopt](#execute-hyperopt) -- [Understand the hyperopt result](#understand-the-hyperopt-result) +!!! Bug + Hyperopt will crash when used with only 1 CPU Core as found out in [Issue #1133](https://github.com/freqtrade/freqtrade/issues/1133) ## Prepare Hyperopting -Before we start digging in Hyperopt, we recommend you to take a look at -an example hyperopt file located into [user_data/hyperopts/](https://github.com/gcarq/freqtrade/blob/develop/user_data/hyperopts/test_hyperopt.py) +Before we start digging in Hyperopt, we recommend you to take a look at +an example hyperopt file located into [user_data/hyperopts/](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/test_hyperopt.py) ### 1. Install a Custom Hyperopt File -This is very simple. Put your hyperopt file into the folder +This is very simple. Put your hyperopt file into the folder `user_data/hyperopts`. -Let assume you want a hyperopt file `awesome_hyperopt.py`: -1. Copy the file `user_data/hyperopts/sample_hyperopt.py` into `user_data/hyperopts/awesome_hyperopt.py` +Let assume you want a hyperopt file `awesome_hyperopt.py`:
+Copy the file `user_data/hyperopts/sample_hyperopt.py` into `user_data/hyperopts/awesome_hyperopt.py` + - ### 2. Configure your Guards and Triggers -There are two places you need to change in your hyperopt file to add a +There are two places you need to change in your hyperopt file to add a new buy hyperopt for testing: - Inside [populate_buy_trend()](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/test_hyperopt.py#L230-L251). - Inside [indicator_space()](https://github.com/freqtrade/freqtrade/blob/develop/user_data/hyperopts/test_hyperopt.py#L207-L223). There you have two different types of indicators: 1. `guards` and 2. `triggers`. -1. Guards are conditions like "never buy if ADX < 10", or never buy if +1. Guards are conditions like "never buy if ADX < 10", or never buy if current price is over EMA10. -2. Triggers are ones that actually trigger buy in specific moment, like -"buy when EMA5 crosses over EMA10" or "buy when close price touches lower +2. Triggers are ones that actually trigger buy in specific moment, like +"buy when EMA5 crosses over EMA10" or "buy when close price touches lower bollinger band". -Hyperoptimization will, for each eval round, pick one trigger and possibly -multiple guards. The constructed strategy will be something like -"*buy exactly when close price touches lower bollinger band, BUT only if +Hyperoptimization will, for each eval round, pick one trigger and possibly +multiple guards. The constructed strategy will be something like +"*buy exactly when close price touches lower bollinger band, BUT only if ADX > 10*". If you have updated the buy strategy, ie. changed the contents of -`populate_buy_trend()` method you have to update the `guards` and +`populate_buy_trend()` method you have to update the `guards` and `triggers` hyperopts must use. ## Solving a Mystery -Let's say you are curious: should you use MACD crossings or lower Bollinger -Bands to trigger your buys. And you also wonder should you use RSI or ADX to -help with those buy decisions. If you decide to use RSI or ADX, which values -should I use for them? So let's use hyperparameter optimization to solve this +Let's say you are curious: should you use MACD crossings or lower Bollinger +Bands to trigger your buys. And you also wonder should you use RSI or ADX to +help with those buy decisions. If you decide to use RSI or ADX, which values +should I use for them? So let's use hyperparameter optimization to solve this mystery. We will start by defining a search space: @@ -77,8 +69,8 @@ We will start by defining a search space: ] ``` -Above definition says: I have five parameters I want you to randomly combine -to find the best combination. Two of them are integer values (`adx-value` +Above definition says: I have five parameters I want you to randomly combine +to find the best combination. Two of them are integer values (`adx-value` and `rsi-value`) and I want you test in the range of values 20 to 40. Then we have three category variables. First two are either `True` or `False`. We use these to either enable or disable the ADX and RSI guards. The last @@ -117,12 +109,12 @@ with different value combinations. It will then use the given historical data an buys based on the buy signals generated with the above function and based on the results it will end with telling you which paramter combination produced the best profits. -The search for best parameters starts with a few random combinations and then uses a +The search for best parameters starts with a few random combinations and then uses a regressor algorithm (currently ExtraTreesRegressor) to quickly find a parameter combination that minimizes the value of the objective function `calculate_loss` in `hyperopt.py`. The above setup expects to find ADX, RSI and Bollinger Bands in the populated indicators. -When you want to test an indicator that isn't used by the bot currently, remember to +When you want to test an indicator that isn't used by the bot currently, remember to add it to the `populate_indicators()` method in `hyperopt.py`. ## Execute Hyperopt @@ -136,7 +128,7 @@ We strongly recommend to use `screen` or `tmux` to prevent any connection loss. python3 ./freqtrade/main.py -s --hyperopt -c config.json hyperopt -e 5000 ``` -Use `` and `` as the names of the custom strategy +Use `` and `` as the names of the custom strategy (only required for generating sells) and the custom hyperopt used. The `-e` flag will set how many evaluations hyperopt will do. We recommend @@ -161,9 +153,9 @@ python3 ./freqtrade/main.py hyperopt --timerange -200 ### Running Hyperopt with Smaller Search Space Use the `--spaces` argument to limit the search space used by hyperopt. -Letting Hyperopt optimize everything is a huuuuge search space. Often it -might make more sense to start by just searching for initial buy algorithm. -Or maybe you just want to optimize your stoploss or roi table for that awesome +Letting Hyperopt optimize everything is a huuuuge search space. Often it +might make more sense to start by just searching for initial buy algorithm. +Or maybe you just want to optimize your stoploss or roi table for that awesome new buy strategy you have. Legal values are: @@ -189,19 +181,19 @@ with values: You should understand this result like: - The buy trigger that worked best was `bb_lower`. -- You should not use ADX because `adx-enabled: False`) +- You should not use ADX because `adx-enabled: False`) - You should **consider** using the RSI indicator (`rsi-enabled: True` and the best value is `29.0` (`rsi-value: 29.0`) -You have to look inside your strategy file into `buy_strategy_generator()` +You have to look inside your strategy file into `buy_strategy_generator()` method, what those values match to. - + So for example you had `rsi-value: 29.0` so we would look at `rsi`-block, that translates to the following code block: ``` (dataframe['rsi'] < 29.0) ``` - -Translating your whole hyperopt result as the new buy-signal + +Translating your whole hyperopt result as the new buy-signal would then look like: ```python @@ -245,9 +237,9 @@ Once the optimized strategy has been implemented into your strategy, you should To archive the same results (number of trades, ...) than during hyperopt, please use the command line flag `--disable-max-market-positions`. This setting is the default for hyperopt for speed reasons. You can overwrite this in the configuration by setting `"position_stacking"=false` or by changing the relevant line in your hyperopt file [here](https://github.com/freqtrade/freqtrade/blob/develop/freqtrade/optimize/hyperopt.py#L283). -Dry/live runs will **NOT** use position stacking - therefore it does make sense to also validate the strategy without this as it's closer to reality. +Dry/live runs will **NOT** use position stacking - therefore it does make sense to also validate the strategy without this as it's closer to reality. ## Next Step Now you have a perfect bot and want to control it from Telegram. Your -next step is to learn the [Telegram usage](https://github.com/freqtrade/freqtrade/blob/develop/docs/telegram-usage.md). +next step is to learn the [Telegram usage](telegram-usage.md). diff --git a/docs/index.md b/docs/index.md index afbc0a73a..92ea4fe43 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,39 +1,67 @@ -# Introduction +# Freqtrade +[![Build Status](https://travis-ci.org/freqtrade/freqtrade.svg?branch=develop)](https://travis-ci.org/freqtrade/freqtrade) +[![Coverage Status](https://coveralls.io/repos/github/freqtrade/freqtrade/badge.svg?branch=develop&service=github)](https://coveralls.io/github/freqtrade/freqtrade?branch=develop) +[![Maintainability](https://api.codeclimate.com/v1/badges/5737e6d668200b7518ff/maintainability)](https://codeclimate.com/github/freqtrade/freqtrade/maintainability) -Welcome to freqtrade documentation. Please feel free to contribute to -this documentation if you see it became outdated by sending us a -Pull-request. Do not hesitate to reach us on -[Slack](https://join.slack.com/t/highfrequencybot/shared_invite/enQtMjQ5NTM0OTYzMzY3LWMxYzE3M2MxNDdjMGM3ZTYwNzFjMGIwZGRjNTc3ZGU3MGE3NzdmZGMwNmU3NDM5ZTNmM2Y3NjRiNzk4NmM4OGE) - if you do not find the answer to your questions. + +Star + +Fork + +Download + +Follow @freqtrade +## Introduction +Freqtrade is a cryptocurrency trading bot written in Python. -## Table of Contents +!!! Danger "DISCLAIMER" + This software is for educational purposes only. Do not risk money which you are afraid to lose. USE THE SOFTWARE AT YOUR OWN RISK. THE AUTHORS AND ALL AFFILIATES ASSUME NO RESPONSIBILITY FOR YOUR TRADING RESULTS. -- [Pre-requisite](https://github.com/freqtrade/freqtrade/blob/develop/docs/pre-requisite.md) - - [Setup your Bittrex account](https://github.com/freqtrade/freqtrade/blob/develop/docs/pre-requisite.md#setup-your-bittrex-account) - - [Setup your Telegram bot](https://github.com/freqtrade/freqtrade/blob/develop/docs/pre-requisite.md#setup-your-telegram-bot) -- [Bot Installation](https://github.com/freqtrade/freqtrade/blob/develop/docs/installation.md) - - [Install with Docker (all platforms)](https://github.com/freqtrade/freqtrade/blob/develop/docs/installation.md#docker) - - [Install on Linux Ubuntu](https://github.com/freqtrade/freqtrade/blob/develop/docs/installation.md#21-linux---ubuntu-1604) - - [Install on MacOS](https://github.com/freqtrade/freqtrade/blob/develop/docs/installation.md#23-macos-installation) - - [Install on Windows](https://github.com/freqtrade/freqtrade/blob/develop/docs/installation.md#windows) -- [Bot Configuration](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md) -- [Bot usage (Start your bot)](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md) - - [Bot commands](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md#bot-commands) - - [Backtesting commands](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md#backtesting-commands) - - [Hyperopt commands](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md#hyperopt-commands) - - [Edge commands](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-usage.md#edge-commands) -- [Bot Optimization](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md) - - [Change your strategy](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md#change-your-strategy) - - [Add more Indicator](https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md#add-more-indicator) - - [Test your strategy with Backtesting](https://github.com/freqtrade/freqtrade/blob/develop/docs/backtesting.md) - - [Edge positioning](https://github.com/freqtrade/freqtrade/blob/develop/docs/edge.md) - - [Find optimal parameters with Hyperopt](https://github.com/freqtrade/freqtrade/blob/develop/docs/hyperopt.md) -- [Control the bot with telegram](https://github.com/freqtrade/freqtrade/blob/develop/docs/telegram-usage.md) -- [Receive notifications via webhook](https://github.com/freqtrade/freqtrade/blob/develop/docs/webhook-config.md) -- [Contribute to the project](https://github.com/freqtrade/freqtrade/blob/develop/CONTRIBUTING.md) - - [How to contribute](https://github.com/freqtrade/freqtrade/blob/develop/CONTRIBUTING.md) - - [Run tests & Check PEP8 compliance](https://github.com/freqtrade/freqtrade/blob/develop/CONTRIBUTING.md) -- [FAQ](https://github.com/freqtrade/freqtrade/blob/develop/docs/faq.md) - - [SQL cheatsheet](https://github.com/freqtrade/freqtrade/blob/develop/docs/sql_cheatsheet.md) -- [Sandbox Testing](https://github.com/freqtrade/freqtrade/blob/develop/docs/sandbox-testing.md) -- [Developer Docs](https://github.com/freqtrade/freqtrade/blob/develop/docs/developer.md) + Always start by running a trading bot in Dry-run and do not engage money before you understand how it works and what profit/loss you should expect. + + We strongly recommend you to have coding and Python knowledge. Do not hesitate to read the source code and understand the mechanism of this bot. + + +## Features + - Based on Python 3.6+: For botting on any operating system - Windows, macOS and Linux + - Persistence: Persistence is achieved through sqlite + - Dry-run: Run the bot without playing money. + - Backtesting: Run a simulation of your buy/sell strategy. + - Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data. + - Edge position sizing Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. Learn more + - Whitelist crypto-currencies: Select which crypto-currency you want to trade or use dynamic whitelists. + - Blacklist crypto-currencies: Select which crypto-currency you want to avoid. + - Manageable via Telegram: Manage the bot with Telegram + - Display profit/loss in fiat: Display your profit/loss in 33 fiat. + - Daily summary of profit/loss: Provide a daily summary of your profit/loss. + - Performance status report: Provide a performance status of your current trades. + + +## Requirements +### Uptodate clock +The clock must be accurate, syncronized to a NTP server very frequently to avoid problems with communication to the exchanges. + +### Hardware requirements +To run this bot we recommend you a cloud instance with a minimum of: + +- 2GB RAM +- 1GB disk space +- 2vCPU + +### Software requirements +- Python 3.6.x +- pip +- git +- TA-Lib +- virtualenv (Recommended) +- Docker (Recommended) + + +## Support +Help / Slack +For any questions not covered by the documentation or for further information about the bot, we encourage you to join our slack channel. + +Click [here](https://join.slack.com/t/highfrequencybot/shared_invite/enQtMjQ5NTM0OTYzMzY3LWMxYzE3M2MxNDdjMGM3ZTYwNzFjMGIwZGRjNTc3ZGU3MGE3NzdmZGMwNmU3NDM5ZTNmM2Y3NjRiNzk4NmM4OGE) to join Slack channel. + +## Ready to try? +Begin by reading our installation guide [here](installation). \ No newline at end of file diff --git a/docs/installation.md b/docs/installation.md index 71ae5a6b5..e5f514eb1 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -1,25 +1,69 @@ # Installation - This page explains how to prepare your environment for running the bot. -To understand how to set up the bot please read the [Bot Configuration](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md) page. +## Prerequisite +Before running your bot in production you will need to setup few +external API. In production mode, the bot required valid Bittrex API +credentials and a Telegram bot (optional but recommended). -## Table of Contents +- [Setup your exchange account](#setup-your-exchange-account) +- [Backtesting commands](#setup-your-telegram-bot) -* [Table of Contents](#table-of-contents) -* [Easy Installation - Linux Script](#easy-installation---linux-script) -* [Automatic Installation - Docker](#automatic-installation---docker) -* [Custom Linux MacOS Installation](#custom-installation) - - [Requirements](#requirements) - - [Linux - Ubuntu 16.04](#linux---ubuntu-1604) - - [MacOS](#macos) - - [Setup Config and virtual env](#setup-config-and-virtual-env) -* [Windows](#windows) +### Setup your exchange account +*To be completed, please feel free to complete this section.* - +### Setup your Telegram bot +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 Telegram bot +**1.1. Start a chat with https://telegram.me/BotFather** + +**1.2. Send the message `/newbot`. ** *BotFather response:* +``` +Alright, a new bot. How are we going to call it? Please choose a name for your bot. +``` + +**1.3. Choose the public name of your bot (e.x. `Freqtrade bot`)** +*BotFather response:* +``` +Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot. +``` +**1.4. Choose the name id of your bot (e.x "`My_own_freqtrade_bot`")** + +**1.5. Father bot will return you the token (API key)**
+Copy it and keep it you will use it for the config parameter `token`. +*BotFather response:* +```hl_lines="4" +Done! Congratulations on your new bot. You will find it at t.me/My_own_freqtrade_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this. + +Use this token to access the HTTP API: +521095879:AAEcEZEL7ADJ56FtG_qD0bQJSKETbXCBCi0 + +For a description of the Bot API, see this page: https://core.telegram.org/bots/api +``` +**1.6. Don't forget to start the conversation with your bot, by clicking /START button** + +### 2. Get your user id +**2.1. Talk to https://telegram.me/userinfobot** + +**2.2. Get your "Id", you will use it for the config parameter +`chat_id`.** +
+## Quick start +Freqtrade provides a Linux/MacOS script to install all dependencies and help you to configure the bot. + +```bash +git clone git@github.com:freqtrade/freqtrade.git +cd freqtrade +git checkout develop +./setup.sh --install +``` +!!! Note + Windows installation is explained [here](#windows). +
## Easy Installation - Linux Script If you are on Debian, Ubuntu or MacOS a freqtrade provides a script to Install, Update, Configure, and Reset your bot. @@ -33,7 +77,7 @@ usage: -c,--config Easy config generator (Will override your existing file). ``` -### --install +** --install ** This script will install everything you need to run the bot: @@ -43,15 +87,15 @@ This script will install everything you need to run the bot: This script is a combination of `install script` `--reset`, `--config` -### --update +** --update ** Update parameter will pull the last version of your current branch and update your virtualenv. -### --reset +** --reset ** Reset parameter will hard reset your branch (only if you are on `master` or `develop`) and recreate your virtualenv. -### --config +** --config ** Config parameter is a `config.json` configurator. This script will ask you questions to setup your bot and create your `config.json`. @@ -69,33 +113,33 @@ Once you have Docker installed, simply create the config file (e.g. `config.json ### 1. Prepare the Bot -#### 1.1. Clone the git repository +**1.1. Clone the git repository** ```bash git clone https://github.com/freqtrade/freqtrade.git ``` -#### 1.2. (Optional) Checkout the develop branch +**1.2. (Optional) Checkout the develop branch** ```bash git checkout develop ``` -#### 1.3. Go into the new directory +**1.3. Go into the new directory** ```bash cd freqtrade ``` -#### 1.4. Copy `config.json.example` to `config.json` +**1.4. Copy `config.json.example` to `config.json`** ```bash cp -n config.json.example config.json ``` -> To edit the config please refer to the [Bot Configuration](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md) page. +> To edit the config please refer to the [Bot Configuration](configuration.md) page. -#### 1.5. Create your database file *(optional - the bot will create it if it is missing)* +**1.5. Create your database file *(optional - the bot will create it if it is missing)** Production @@ -115,7 +159,7 @@ Either use the prebuilt image from docker hub - or build the image yourself if y Branches / tags available can be checked out on [Dockerhub](https://hub.docker.com/r/freqtradeorg/freqtrade/tags/). -#### 2.1. Download the docker image +**2.1. Download the docker image** Pull the image from docker hub and (optionally) change the name of the image @@ -127,7 +171,7 @@ docker tag freqtradeorg/freqtrade:develop freqtrade To update the image, simply run the above commands again and restart your running container. -#### 2.2. Build the Docker image +**2.2. Build the Docker image** ```bash cd freqtrade @@ -164,7 +208,7 @@ There is known issue in OSX Docker versions after 17.09.1, whereby /etc/localtim docker run --rm -e TZ=`ls -la /etc/localtime | cut -d/ -f8-9` -v `pwd`/config.json:/freqtrade/config.json -it freqtrade ``` -More information on this docker issue and work-around can be read [here](https://github.com/docker/for-mac/issues/2396) +More information on this docker issue and work-around can be read [here](https://github.com/docker/for-mac/issues/2396). In this example, the database will be created inside the docker instance and will be lost when you will refresh your image. @@ -172,7 +216,7 @@ In this example, the database will be created inside the docker instance and wil To run a restartable instance in the background (feel free to place your configuration and database files wherever it feels comfortable on your filesystem). -#### 5.1. Move your config file and database +**5.1. Move your config file and database** ```bash mkdir ~/.freqtrade @@ -180,7 +224,7 @@ mv config.json ~/.freqtrade mv tradesv3.sqlite ~/.freqtrade ``` -#### 5.2. Run the docker image +**5.2. Run the docker image** ```bash docker run -d \ @@ -191,8 +235,9 @@ docker run -d \ freqtrade --db-url sqlite:///tradesv3.sqlite ``` -*Note*: db-url defaults to `sqlite:///tradesv3.sqlite` but it defaults to `sqlite://` if `dry_run=True` is being used. -To override this behaviour use a custom db-url value: i.e.: `--db-url sqlite:///tradesv3.dryrun.sqlite` +!!! Note + db-url defaults to `sqlite:///tradesv3.sqlite` but it defaults to `sqlite://` if `dry_run=True` is being used. + To override this behaviour use a custom db-url value: i.e.: `--db-url sqlite:///tradesv3.dryrun.sqlite` ### 6. Monitor your Docker instance @@ -208,14 +253,15 @@ docker start freqtrade For more information on how to operate Docker, please refer to the [official Docker documentation](https://docs.docker.com/). -*Note*: You do not need to rebuild the image for configuration changes, it will suffice to edit `config.json` and restart the container. +!!! Note + You do not need to rebuild the image for configuration changes, it will suffice to edit `config.json` and restart the container. ### 7. Backtest with docker The following assumes that the above steps (1-4) have been completed successfully. Also, backtest-data should be available at `~/.freqtrade/user_data/`. -``` bash +```bash docker run -d \ --name freqtrade \ -v /etc/localtime:/etc/localtime:ro \ @@ -225,16 +271,17 @@ docker run -d \ freqtrade --strategy AwsomelyProfitableStrategy backtesting ``` -Head over to the [Backtesting Documentation](https://github.com/freqtrade/freqtrade/blob/develop/docs/backtesting.md) for more details. +Head over to the [Backtesting Documentation](backtesting.md) for more details. -*Note*: Additional parameters can be appended after the image name (`freqtrade` in the above example). +!!! Note + Additional parameters can be appended after the image name (`freqtrade` in the above example). ------ ## Custom Installation We've included/collected install instructions for Ubuntu 16.04, MacOS, and Windows. These are guidelines and your success may vary with other distros. -OS Specific steps are listed first, the [common](#common) section below is necessary for all systems. +OS Specific steps are listed first, the [Common](#common) section below is necessary for all systems. ### Requirements @@ -286,7 +333,7 @@ python3 -m pip install -e . brew install python3 git wget ``` -### common +### Common #### 1. Install TA-Lib @@ -304,11 +351,13 @@ cd .. rm -rf ./ta-lib* ``` -*Note*: An already downloaded version of ta-lib is included in the repository, as the sourceforge.net source seems to have problems frequently. +!!! Note + An already downloaded version of ta-lib is included in the repository, as the sourceforge.net source seems to have problems frequently. #### 2. Setup your Python virtual environment (virtualenv) -*Note*: This step is optional but strongly recommended to keep your system organized +!!! Note + This step is optional but strongly recommended to keep your system organized ```bash python3 -m venv .env @@ -337,7 +386,7 @@ cd freqtrade cp config.json.example config.json ``` -> *To edit the config please refer to [Bot Configuration](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md).* +> *To edit the config please refer to [Bot Configuration](configuration.md).* #### 5. Install python dependencies @@ -396,7 +445,7 @@ copy paste `config.json` to ``\path\freqtrade-develop\freqtrade` Install ta-lib according to the [ta-lib documentation](https://github.com/mrjbq7/ta-lib#windows). -As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), there is also a repository of inofficial precompiled windows Wheels [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib), which needs to be downloaded and installed using `pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win32.whl` (make sure to use the version matching your python version) +As compiling from source on windows has heavy dependencies (requires a partial visual studio installation), there is also a repository of unofficial precompiled windows Wheels [here](https://www.lfd.uci.edu/~gohlke/pythonlibs/#ta-lib), which needs to be downloaded and installed using `pip install TA_Lib‑0.4.17‑cp36‑cp36m‑win32.whl` (make sure to use the version matching your python version) ```cmd >cd \path\freqtrade-develop @@ -426,4 +475,4 @@ The easiest way is to download install Microsoft Visual Studio Community [here]( --- Now you have an environment ready, the next step is -[Bot Configuration](https://github.com/freqtrade/freqtrade/blob/develop/docs/configuration.md)... +[Bot Configuration](configuration.md). diff --git a/docs/partials/header.html b/docs/partials/header.html new file mode 100644 index 000000000..84c254b5a --- /dev/null +++ b/docs/partials/header.html @@ -0,0 +1,52 @@ +
+ + + +
\ No newline at end of file diff --git a/docs/plotting.md b/docs/plotting.md index 54a4bb4b8..3f2d38d0b 100644 --- a/docs/plotting.md +++ b/docs/plotting.md @@ -1,10 +1,6 @@ # Plotting This page explains how to plot prices, indicator, profits. -## Table of Contents -- [Plot price and indicators](#plot-price-and-indicators) -- [Plot profit](#plot-profit) - ## Installation Plotting scripts use Plotly library. Install/upgrade it with: @@ -48,7 +44,7 @@ To plot trades stored in a database use `--db-url` argument: python scripts/plot_dataframe.py --db-url sqlite:///tradesv3.dry_run.sqlite -p BTC/ETH ``` -To plot a test strategy the strategy should have first be backtested. +To plot a test strategy the strategy should have first be backtested. The results may then be plotted with the -s argument: ``` python scripts/plot_dataframe.py -s Strategy_Name -p BTC/ETH --datadir user_data/data// diff --git a/docs/pre-requisite.md b/docs/pre-requisite.md deleted file mode 100644 index 2ff3f08b5..000000000 --- a/docs/pre-requisite.md +++ /dev/null @@ -1,46 +0,0 @@ -# Pre-requisite -Before running your bot in production you will need to setup few -external API. In production mode, the bot required valid Bittrex API -credentials and a Telegram bot (optional but recommended). - -- [Setup your Bittrex account](#setup-your-bittrex-account) -- [Backtesting commands](#setup-your-telegram-bot) - -## Setup your Bittrex account -*To be completed, please feel free to complete this section.* - -## Setup your Telegram bot -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 Telegram bot -**1.1. Start a chat with https://telegram.me/BotFather** -**1.2. Send the message** `/newbot` -*BotFather response:* -``` -Alright, a new bot. How are we going to call it? Please choose a name for your bot. -``` -**1.3. Choose the public name of your bot (e.g "`Freqtrade bot`")** -*BotFather response:* -``` -Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot. -``` -**1.4. Choose the name id of your bot (e.g "`My_own_freqtrade_bot`")** -**1.5. Father bot will return you the token (API key)** -Copy it and keep it you will use it for the config parameter `token`. -*BotFather response:* -``` -Done! Congratulations on your new bot. You will find it at t.me/My_own_freqtrade_bot. You can now add a description, about section and profile picture for your bot, see /help for a list of commands. By the way, when you've finished creating your cool bot, ping our Bot Support if you want a better username for it. Just make sure the bot is fully operational before you do this. - -Use this token to access the HTTP API: -521095879:AAEcEZEL7ADJ56FtG_qD0bQJSKETbXCBCi0 - -For a description of the Bot API, see this page: https://core.telegram.org/bots/api -``` -**1.6. Don't forget to start the conversation with your bot, by clicking /START button** - -### 2. Get your user id -**2.1. Talk to https://telegram.me/userinfobot** -**2.2. Get your "Id", you will use it for the config parameter -`chat_id`.** diff --git a/docs/telegram-usage.md b/docs/telegram-usage.md index 28213fb5d..e01c8f9bc 100644 --- a/docs/telegram-usage.md +++ b/docs/telegram-usage.md @@ -2,14 +2,14 @@ This page explains how to command your bot with Telegram. -## Pre-requisite -To control your bot with Telegram, you need first to -[set up a Telegram bot](https://github.com/freqtrade/freqtrade/blob/develop/docs/pre-requisite.md) +## Prerequisite +To control your bot with Telegram, you need first to +[set up a Telegram bot](installation.md) and add your Telegram API keys into your config file. ## Telegram commands -Per default, the Telegram bot shows predefined commands. Some commands -are only available by sending them to the bot. The table below list the +Per default, the Telegram bot shows predefined commands. Some commands +are only available by sending them to the bot. The table below list the official commands. You can ask at any moment for help with `/help`. | Command | Default | Description | @@ -40,30 +40,30 @@ Below, example of Telegram message you will receive for each command. ### /stop -> `Stopping trader ...` +> `Stopping trader ...` > **Status:** `stopped` ## /status For each open trade, the bot will send you the following message. -> **Trade ID:** `123` +> **Trade ID:** `123` > **Current Pair:** CVC/BTC -> **Open Since:** `1 days ago` -> **Amount:** `26.64180098` -> **Open Rate:** `0.00007489` -> **Close Rate:** `None` -> **Current Rate:** `0.00007489` -> **Close Profit:** `None` -> **Current Profit:** `12.95%` +> **Open Since:** `1 days ago` +> **Amount:** `26.64180098` +> **Open Rate:** `0.00007489` +> **Close Rate:** `None` +> **Current Rate:** `0.00007489` +> **Close Profit:** `None` +> **Current Profit:** `12.95%` > **Open Order:** `None` ## /status table Return the status of all open trades in a table format. ``` - ID Pair Since Profit ----- -------- ------- -------- + ID Pair Since Profit +---- -------- ------- -------- 67 SC/BTC 1 d 13.33% 123 CVC/BTC 1 h 12.95% ``` @@ -73,32 +73,32 @@ Return the status of all open trades in a table format. Return the number of trades used and available. ``` current max ---------- ----- - 2 10 +--------- ----- + 2 10 ``` ## /profit Return a summary of your profit/loss and performance. -> **ROI:** Close trades -> ∙ `0.00485701 BTC (258.45%)` -> ∙ `62.968 USD` -> **ROI:** All trades -> ∙ `0.00255280 BTC (143.43%)` -> ∙ `33.095 EUR` -> -> **Total Trade Count:** `138` -> **First Trade opened:** `3 days ago` -> **Latest Trade opened:** `2 minutes ago` -> **Avg. Duration:** `2:33:45` +> **ROI:** Close trades +> ∙ `0.00485701 BTC (258.45%)` +> ∙ `62.968 USD` +> **ROI:** All trades +> ∙ `0.00255280 BTC (143.43%)` +> ∙ `33.095 EUR` +> +> **Total Trade Count:** `138` +> **First Trade opened:** `3 days ago` +> **Latest Trade opened:** `2 minutes ago` +> **Avg. Duration:** `2:33:45` > **Best Performing:** `PAY/BTC: 50.23%` ## /forcesell > **BITTREX:** Selling BTC/LTC with limit `0.01650000 (profit: ~-4.07%, -0.00008168)` -## /forcebuy +## /forcebuy > **BITTREX**: Buying ETH/BTC with limit `0.03400000` (`1.000000 ETH`, `225.290 USD`) @@ -107,7 +107,7 @@ Note that for this to work, `forcebuy_enable` needs to be set to true. ## /performance Return the performance of each crypto-currency the bot has sold. -> Performance: +> Performance: > 1. `RCN/BTC 57.77%` > 2. `PAY/BTC 56.91%` > 3. `VIB/BTC 47.07%` @@ -119,31 +119,30 @@ Return the performance of each crypto-currency the bot has sold. Return the balance of all crypto-currency your have on the exchange. -> **Currency:** BTC -> **Available:** 3.05890234 -> **Balance:** 3.05890234 -> **Pending:** 0.0 +> **Currency:** BTC +> **Available:** 3.05890234 +> **Balance:** 3.05890234 +> **Pending:** 0.0 -> **Currency:** CVC -> **Available:** 86.64180098 -> **Balance:** 86.64180098 +> **Currency:** CVC +> **Available:** 86.64180098 +> **Balance:** 86.64180098 > **Pending:** 0.0 ## /daily -Per default `/daily` will return the 7 last days. +Per default `/daily` will return the 7 last days. The example below if for `/daily 3`: > **Daily Profit over the last 3 days:** ``` -Day Profit BTC Profit USD ----------- -------------- ------------ -2018-01-03 0.00224175 BTC 29,142 USD -2018-01-02 0.00033131 BTC 4,307 USD +Day Profit BTC Profit USD +---------- -------------- ------------ +2018-01-03 0.00224175 BTC 29,142 USD +2018-01-02 0.00033131 BTC 4,307 USD 2018-01-01 0.00269130 BTC 34.986 USD ``` ## /version -> **Version:** `0.14.3` - +> **Version:** `0.14.3` diff --git a/mkdocs.yml b/mkdocs.yml index 7ad68178b..07672884a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,13 +1,43 @@ site_name: Freqtrade +nav: + - About: index.md + - Installation: installation.md + - Configuration: configuration.md + - Start the bot: bot-usage.md + - Optimization: bot-optimization.md + - Backtesting: backtesting.md + - Hyperopt: hyperopt.md + - Stoploss: stoploss.md + - Telegram: telegram-usage.md + - Plotting: plotting.md + - Edge positioning: edge.md + - Web Hook: webhook-config.md + - FAQ: faq.md + - Contributors guide: developer.md + - SQL Cheatsheeet: sql_cheatsheet.md + - Sanbox testing: sandbox-testing.md theme: name: material logo: 'images/logo.png' + custom_dir: 'docs' palette: primary: 'blue grey' accent: 'tear' markdown_extensions: - - admonition - - codehilite: - guess_lang: false - - toc: - permalink: false \ No newline at end of file + - admonition + - codehilite: + guess_lang: false + - toc: + permalink: true + - pymdownx.arithmatex + - pymdownx.caret + - pymdownx.critic + - pymdownx.details + - pymdownx.inlinehilite + - pymdownx.magiclink + - pymdownx.mark + - pymdownx.smartsymbols + - pymdownx.superfences + - pymdownx.tasklist: + custom_checkbox: true + - pymdownx.tilde \ No newline at end of file