From 86b3306a3b7910360a4abeb05eb1763a6f08f924 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 19 Jan 2021 22:07:10 +0100 Subject: [PATCH] Small doc refactoring --- docs/configuration.md | 58 +++++++++++---------------------------- docs/strategy-advanced.md | 26 ++++++++++++++++++ 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index 9a3126618..781435271 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -277,6 +277,22 @@ before asking the strategy if we should buy or a sell an asset. After each wait every opened trade wether or not we should sell, and for all the remaining pairs (either the dynamic list of pairs or the static list of pairs) if we should buy. +### Ignoring expired candles + +When working with larger timeframes (for example 1h or more) and using a low `max_open_trades` value, the last candle can be processed as soon as a trade slot becomes available. When processing the last candle, this can lead to a situation where it may not be desirable to use the buy signal on that candle. For example, when using a condition in your strategy where you use a cross-over, that point may have passed too long ago for you to start a trade on it. + +In these situations, you can enable the functionality to ignore candles that are beyond a specified period by setting `ask_strategy.ignore_buying_expired_candle_after` to a positive number, indicating the number of seconds after which the buy signal becomes expired. + +For example, if your strategy is using a 1h timeframe, and you only want to buy within the first 5 minutes when a new candle comes in, you can add the following configuration to your strategy: + +``` json + "ask_strategy":{ + "ignore_buying_expired_candle_after": 300, + "price_side": "bid", + // ... + }, +``` + ### Understand order_types The `order_types` configuration parameter maps actions (`buy`, `sell`, `stoploss`, `emergencysell`) to order-types (`market`, `limit`, ...) as well as configures stoploss to be on the exchange and defines stoploss on exchange update interval in seconds. @@ -676,48 +692,6 @@ export HTTPS_PROXY="http://addr:port" freqtrade ``` -## Ignoring expired candles - -When working with larger timeframes (for example 1h or more) and using a low `max_open_trades` value, the last candle can be processed as soon as a trade slot becomes available. When processing the last candle, this can lead to a situation where it may not be desirable to use the buy signal on that candle. For example, when using a condition in your strategy where you use a cross-over, that point may have passed too long ago for you to start a trade on it. - -In these situations, you can enable the functionality to ignore candles that are beyond a specified period by setting `ask_strategy.ignore_buying_expired_candle_after` to a positive number, indicating the number of seconds after which the buy signal becomes expired. - -For example, if your strategy is using a 1h timeframe, and you only want to buy within the first 5 minutes when a new candle comes in, you can add the following configuration to your strategy: - -``` jsonc - "ask_strategy":{ - "ignore_buying_expired_candle_after" = 300 # 5 minutes - "price_side": "bid", - // ... - }, -``` - -## Embedding Strategies - -Freqtrade provides you with with an easy way to embed the strategy into your configuration file. -This is done by utilizing BASE64 encoding and providing this string at the strategy configuration field, -in your chosen config file. - -### Encoding a string as BASE64 - -This is a quick example, how to generate the BASE64 string in python - -```python -from base64 import urlsafe_b64encode - -with open(file, 'r') as f: - content = f.read() -content = urlsafe_b64encode(content.encode('utf-8')) -``` - -The variable 'content', will contain the strategy file in a BASE64 encoded form. Which can now be set in your configurations file as following - -```json -"strategy": "NameOfStrategy:BASE64String" -``` - -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](bot-usage.md). diff --git a/docs/strategy-advanced.md b/docs/strategy-advanced.md index 2431274d7..25d217d34 100644 --- a/docs/strategy-advanced.md +++ b/docs/strategy-advanced.md @@ -398,3 +398,29 @@ class MyAwesomeStrategy2(MyAwesomeStrategy): ``` Both attributes and methods may be overridden, altering behavior of the original strategy in a way you need. + +## Embedding Strategies + +Freqtrade provides you with with an easy way to embed the strategy into your configuration file. +This is done by utilizing BASE64 encoding and providing this string at the strategy configuration field, +in your chosen config file. + +### Encoding a string as BASE64 + +This is a quick example, how to generate the BASE64 string in python + +```python +from base64 import urlsafe_b64encode + +with open(file, 'r') as f: + content = f.read() +content = urlsafe_b64encode(content.encode('utf-8')) +``` + +The variable 'content', will contain the strategy file in a BASE64 encoded form. Which can now be set in your configurations file as following + +```json +"strategy": "NameOfStrategy:BASE64String" +``` + +Please ensure that 'NameOfStrategy' is identical to the strategy name!