Update buy_timeout and sell_timeout methods

This commit is contained in:
Matthias
2022-03-25 19:46:56 +01:00
parent 973644de66
commit 6f1b14c013
11 changed files with 175 additions and 106 deletions
+28
View File
@@ -11,6 +11,8 @@ If you intend on using markets other than spot markets, please migrate your stra
* `populate_buy_trend()` -> `populate_entry_trend()`
* `populate_sell_trend()` -> `populate_exit_trend()`
* `custom_sell()` -> `custom_exit()`
* `check_buy_timeout()` -> `check_entry_timeout()`
* `check_sell_timeout()` -> `check_exit_timeout()`
* Dataframe columns:
* `buy` -> `enter_long`
* `sell` -> `exit_long`
@@ -124,6 +126,32 @@ class AwesomeStrategy(IStrategy):
# ...
```
### `custom_entry_timeout`
`check_buy_timeout()` has been renamed to `check_entry_timeout()`, and `check_sell_timeout()` has been renamed to `check_exit_timeout()`.
``` python hl_lines="2 6"
class AwesomeStrategy(IStrategy):
def check_buy_timeout(self, pair: str, trade: 'Trade', order: dict,
current_time: datetime, **kwargs) -> bool:
return False
def check_sell_timeout(self, pair: str, trade: 'Trade', order: dict,
current_time: datetime, **kwargs) -> bool:
return False
```
``` python hl_lines="2 6"
class AwesomeStrategy(IStrategy):
def check_entry_timeout(self, pair: str, trade: 'Trade', order: dict,
current_time: datetime, **kwargs) -> bool:
return False
def check_exit_timeout(self, pair: str, trade: 'Trade', order: dict,
current_time: datetime, **kwargs) -> bool:
return False
```
### Custom-stake-amount
New string argument `side` - which can be either `"long"` or `"short"`.