mirror of
https://github.com/freqtrade/freqtrade.git
synced 2026-02-24 21:30:51 +00:00
add trade param to custom entry price in interface, bot, backtesting, exemples
This commit is contained in:
@@ -520,7 +520,7 @@ class AwesomeStrategy(IStrategy):
|
||||
|
||||
# ... populate_* methods
|
||||
|
||||
def custom_entry_price(self, pair: str, current_time: datetime, proposed_rate: float,
|
||||
def custom_entry_price(self, pair: str, trade: 'Trade', current_time: datetime, proposed_rate: float,
|
||||
entry_tag: Optional[str], side: str, **kwargs) -> float:
|
||||
|
||||
dataframe, last_updated = self.dp.get_analyzed_dataframe(pair=pair,
|
||||
|
||||
@@ -271,7 +271,7 @@ New string argument `side` - which can be either `"long"` or `"short"`.
|
||||
|
||||
``` python hl_lines="3"
|
||||
class AwesomeStrategy(IStrategy):
|
||||
def custom_entry_price(self, pair: str, current_time: datetime, proposed_rate: float,
|
||||
def custom_entry_price(self, pair: str, trade: 'Trade', current_time: datetime, proposed_rate: float,
|
||||
entry_tag: Optional[str], **kwargs) -> float:
|
||||
return proposed_rate
|
||||
```
|
||||
@@ -280,7 +280,7 @@ After:
|
||||
|
||||
``` python hl_lines="3"
|
||||
class AwesomeStrategy(IStrategy):
|
||||
def custom_entry_price(self, pair: str, current_time: datetime, proposed_rate: float,
|
||||
def custom_entry_price(self, pair: str, trade: 'Trade', current_time: datetime, proposed_rate: float,
|
||||
entry_tag: Optional[str], side: str, **kwargs) -> float:
|
||||
return proposed_rate
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user