mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add link between stoploss_from_open and custom_stop documentation
This commit is contained in:
parent
983c0ef118
commit
b6e9e74a8b
|
@ -178,10 +178,9 @@ class AwesomeStrategy(IStrategy):
|
|||
return -0.15
|
||||
```
|
||||
|
||||
|
||||
#### Calculating stoploss relative to open price
|
||||
|
||||
Stoploss values returned from `custom_stoploss()` always specify a percentage relative to `current_rate`. In order to set a stoploss relative to the *open* price, we need to use `current_profit` to calculate what percentage relative to the `current_rate` will give you the same result as if the percentage was specified from the open price.
|
||||
Stoploss values returned from `custom_stoploss()` always specify a percentage relative to `current_rate`. In order to set a stoploss relative to the *open* price, we need to use `current_profit` to calculate what percentage relative to the `current_rate` will give you the same result as if the percentage was specified from the open price.
|
||||
|
||||
The helper function [`stoploss_from_open()`](strategy-customization.md#stoploss_from_open) can be used to convert from an open price relative stop, to a current price relative stop which can be returned from `custom_stoploss()`.
|
||||
|
||||
|
@ -189,7 +188,6 @@ The helper function [`stoploss_from_open()`](strategy-customization.md#stoploss_
|
|||
|
||||
Use the initial stoploss until the profit is above 4%, then use a trailing stoploss of 50% of the current profit with a minimum of 2.5% and a maximum of 5%.
|
||||
|
||||
|
||||
``` python
|
||||
from datetime import datetime, timedelta
|
||||
from freqtrade.persistence import Trade
|
||||
|
|
|
@ -600,9 +600,9 @@ Stoploss values returned from `custom_stoploss` must specify a percentage relati
|
|||
|
||||
``` python
|
||||
|
||||
from freqtrade.strategy import IStrategy, stoploss_from_open
|
||||
from datetime import datetime
|
||||
from freqtrade.persistence import Trade
|
||||
from freqtrade.strategy import IStrategy, stoploss_from_open
|
||||
|
||||
class AwesomeStrategy(IStrategy):
|
||||
|
||||
|
@ -621,6 +621,7 @@ Stoploss values returned from `custom_stoploss` must specify a percentage relati
|
|||
|
||||
```
|
||||
|
||||
Full examples can be found in the [Custom stoploss](strategy-advanced.md#custom-stoploss) section of the Documentation.
|
||||
|
||||
|
||||
## Additional data (Wallets)
|
||||
|
|
Loading…
Reference in New Issue
Block a user