Slightly reword documentation

This commit is contained in:
Matthias 2021-08-14 09:05:03 +02:00
parent 0a6c0c429a
commit 0f7ddabec8
2 changed files with 18 additions and 11 deletions

View File

@ -36,11 +36,12 @@ By default, loop runs every few seconds (`internals.process_throttle_secs`) and
* Calls `check_sell_timeout()` strategy callback for open sell orders.
* Verifies existing positions and eventually places sell orders.
* Considers stoploss, ROI and sell-signal.
* Determine sell-price based on `ask_strategy` configuration setting.
* Determine sell-price based on `ask_strategy` configuration setting or by using the `custom_exit_price()` callback.
* Before a sell order is placed, `confirm_trade_exit()` strategy callback is called.
* Check if trade-slots are still available (if `max_open_trades` is reached).
* Verifies buy signal trying to enter new positions.
* Determine buy-price based on `bid_strategy` configuration setting.
* Determine buy-price based on `bid_strategy` configuration setting, or by using the `custom_entry_price()` callback.
* Determine stake size by calling the `custom_stake_amount()` callback.
* Before a buy order is placed, `confirm_trade_entry()` strategy callback is called.
This loop will be repeated again and again until the bot is stopped.

View File

@ -359,14 +359,15 @@ See [Dataframe access](#dataframe-access) for more information about dataframe u
## Custom order price rules
By default, freqtrade use the orderbook to automatically set an order price, you also have the option to create custom order prices based on your strategy.
By default, freqtrade use the orderbook to automatically set an order price([Relevant documentation](configuration.md#prices-used-for-orders)), you also have the option to create custom order prices based on your strategy.
You can use this feature by creating a custom_entry_price function in your strategy file to customize entry prices and custom_exit_price for exits.
You can use this feature by creating a `custom_entry_price()` function in your strategy file to customize entry prices and custom_exit_price for exits.
!!!Note
If your custom pricing function return None or an invalid value, a default entry or exit price will be chosen based on the current rate.
!!! Note
If your custom pricing function return None or an invalid value, price will fall back to `proposed_rate`, which is based on the regular pricing configuration.
### Custom order entry and exit price example
### Custom order entry and exit price exemple
``` python
from datetime import datetime, timedelta, timezone
from freqtrade.persistence import Trade
@ -380,9 +381,9 @@ class AwesomeStrategy(IStrategy):
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair,
timeframe=self.timeframe)
proposed_entryprice = dataframe['bollinger_10_lowerband'].iat[-1]
new_entryprice = dataframe['bollinger_10_lowerband'].iat[-1]
return proposed_entryprice
return new_entryprice
def custom_exit_price(self, pair: str, trade: Trade,
current_time: datetime, proposed_rate: float,
@ -390,12 +391,17 @@ class AwesomeStrategy(IStrategy):
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair,
timeframe=self.timeframe)
proposed_exitprice = dataframe['bollinger_10_upperband'].iat[-1]
new_exitprice = dataframe['bollinger_10_upperband'].iat[-1]
return proposed_exitprice
return new_exitprice
```
!!! Warning
Modifying entry and exit prices will only work for limit orders. Depending on the price chosen, this can result in a lot of unfilled orders.
!!! Warning "No backtesting support"
Custom entry-prices are currently not supported during backtesting.
## Custom order timeout rules