Fix documentation formatting.

This commit is contained in:
Reigo Reinmets 2021-12-18 18:55:12 +02:00
parent db2f0660fa
commit 1eb83f9a62
2 changed files with 17 additions and 10 deletions

View File

@ -230,15 +230,18 @@ for val in self.buy_ema_short.range:
merged_frame = pd.concat(frames, axis=1)
```
### Adjust trade position
## Adjust trade position
`adjust_trade_position()` can be used to perform additional orders to manage risk with DCA (Dollar Cost Averaging) for example.
!!! Tip: The `position_adjustment_enable` configuration parameter must be enabled to use adjust_trade_position callback in strategy.
!!! Note
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.
``` python
from freqtrade.persistence import Trade
@ -276,7 +279,7 @@ class DigDeeperStrategy(IStrategy):
# Only buy when not actively falling price.
last_candle = dataframe.iloc[-1].squeeze()
previous_candle = dataframe.iloc[-2].squeeze()
if last_candle.close < previous_candle.close:
if last_candle['close'] < previous_candle['close']:
return None
count_of_buys = 0

View File

@ -570,19 +570,23 @@ 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).
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!
!!! 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