add feature custom entry price for live
This commit is contained in:
@@ -357,6 +357,33 @@ See [Dataframe access](#dataframe-access) for more information about dataframe u
|
||||
|
||||
---
|
||||
|
||||
## Custom order entry price rules
|
||||
|
||||
By default, freqtrade use the orderbook to automatically set an order price, you also have the option to create custom order prices based on your strategy.
|
||||
|
||||
You can use this feature by setting the `use_custom_entry_price` option to `true` in config and creating a custom_entry_price function.
|
||||
|
||||
### Custom order entry price exemple
|
||||
``` python
|
||||
from datetime import datetime, timedelta, timezone
|
||||
from freqtrade.persistence import Trade
|
||||
|
||||
class AwesomeStrategy(IStrategy):
|
||||
|
||||
# ... populate_* methods
|
||||
|
||||
def custom_entry_price(self, pair: str, current_time: datetime,
|
||||
current_rate, **kwargs) -> float:
|
||||
|
||||
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair,
|
||||
timeframe=self.timeframe)
|
||||
entryprice = dataframe['bollinger_10_lowerband'].iat[-1]
|
||||
|
||||
return entryprice
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Custom order timeout rules
|
||||
|
||||
Simple, time-based order-timeouts can be configured either via strategy or in the configuration in the `unfilledtimeout` section.
|
||||
@@ -366,7 +393,7 @@ However, freqtrade also offers a custom callback for both order types, which all
|
||||
!!! Note
|
||||
Unfilled order timeouts are not relevant during backtesting or hyperopt, and are only relevant during real (live) trading. Therefore these methods are only called in these circumstances.
|
||||
|
||||
### Custom order timeout example
|
||||
## Custom order timeout example
|
||||
|
||||
A simple example, which applies different unfilled-timeouts depending on the price of the asset can be seen below.
|
||||
It applies a tight timeout for higher priced assets, while allowing more time to fill on cheap coins.
|
||||
|
Reference in New Issue
Block a user