Improve documentation.

This commit is contained in:
Reigo Reinmets 2021-12-12 08:32:15 +02:00
parent 8dacd987b9
commit c6256aba35
2 changed files with 6 additions and 1 deletions

View File

@ -589,7 +589,7 @@ freqtrade
The `position_adjustment_enable` configuration parameter enables the usage of `adjust_trade_position()` callback in strategy. The `position_adjustment_enable` configuration parameter enables the usage of `adjust_trade_position()` callback in strategy.
For performance reasons, it's disabled by default, and freqtrade will show a warning message on startup if enabled. For performance reasons, it's disabled by default, and freqtrade will show a warning message on startup if enabled.
This can be dangerous with some strategies, so use with care. Enabling this does nothing unless the strategy also implements `adjust_trade_position()` callback.
See [the strategy callbacks](strategy-callbacks.md) for details on usage. See [the strategy callbacks](strategy-callbacks.md) for details on usage.

View File

@ -573,12 +573,17 @@ class AwesomeStrategy(IStrategy):
### Adjust trade position ### Adjust trade position
`adjust_trade_position()` can be used to perform additional orders to manage risk with DCA (Dollar Cost Averaging). `adjust_trade_position()` can be used to perform additional orders to manage risk with DCA (Dollar Cost Averaging).
The strategy is expected to return a stake_amount if and when an additional buy order should be made (position is increased).
If there is not enough funds in the wallet then nothing will happen.
Note: Current implementation does not support decreasing position size with partial sales!
!!! Tip: The `position_adjustment_enable` configuration parameter must be enabled to use adjust_trade_position callback in strategy. !!! Tip: The `position_adjustment_enable` configuration parameter must be enabled to use adjust_trade_position callback in strategy.
!!! Warning: Additional orders also mean additional fees. !!! Warning: Additional orders also mean additional fees.
!!! Warning: Stoploss is still calculated from the initial opening price, not averaged price. !!! Warning: Stoploss is still calculated from the initial opening price, not averaged price.
So if you do 3 additional buys at -7% and have a stoploss at -10% then you will most likely trigger stoploss while the UI will be showing you an average profit of -3%.
``` python ``` python
from freqtrade.persistence import Trade from freqtrade.persistence import Trade