Fix documentation formatting.
This commit is contained in:
parent
db2f0660fa
commit
1eb83f9a62
@ -230,15 +230,18 @@ for val in self.buy_ema_short.range:
|
|||||||
merged_frame = pd.concat(frames, axis=1)
|
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.
|
`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
|
``` python
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
@ -276,7 +279,7 @@ class DigDeeperStrategy(IStrategy):
|
|||||||
# Only buy when not actively falling price.
|
# Only buy when not actively falling price.
|
||||||
last_candle = dataframe.iloc[-1].squeeze()
|
last_candle = dataframe.iloc[-1].squeeze()
|
||||||
previous_candle = dataframe.iloc[-2].squeeze()
|
previous_candle = dataframe.iloc[-2].squeeze()
|
||||||
if last_candle.close < previous_candle.close:
|
if last_candle['close'] < previous_candle['close']:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
count_of_buys = 0
|
count_of_buys = 0
|
||||||
|
@ -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).
|
`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).
|
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.
|
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%.
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user