Skip to content

Commit 49e85e0

Browse files
committed
docs: update migration docs to new syntax
only update the "after" parts. No changs to highlighting, as the actual syntax used is not relevant for the strategy.
1 parent e8d7246 commit 49e85e0

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/strategy_migration.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ class AwesomeStrategy(IStrategy):
214214
``` python hl_lines="4"
215215
class AwesomeStrategy(IStrategy):
216216
def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float,
217-
proposed_stake: float, min_stake: Optional[float], max_stake: float,
218-
entry_tag: Optional[str], side: str, **kwargs) -> float:
217+
proposed_stake: float, min_stake: float | None, max_stake: float,
218+
entry_tag: str | None, side: str, **kwargs) -> float:
219219
# ...
220220
return proposed_stake
221221
```
@@ -237,7 +237,7 @@ After:
237237
``` python hl_lines="4"
238238
class AwesomeStrategy(IStrategy):
239239
def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
240-
time_in_force: str, current_time: datetime, entry_tag: Optional[str],
240+
time_in_force: str, current_time: datetime, entry_tag: str | None,
241241
side: str, **kwargs) -> bool:
242242
return True
243243
```
@@ -280,8 +280,8 @@ After:
280280

281281
``` python hl_lines="3"
282282
class AwesomeStrategy(IStrategy):
283-
def custom_entry_price(self, pair: str, trade: Optional[Trade], current_time: datetime, proposed_rate: float,
284-
entry_tag: Optional[str], side: str, **kwargs) -> float:
283+
def custom_entry_price(self, pair: str, trade: Trade | None, current_time: datetime, proposed_rate: float,
284+
entry_tag: str | None, side: str, **kwargs) -> float:
285285
return proposed_rate
286286
```
287287

@@ -312,7 +312,7 @@ After:
312312
``` python hl_lines="5 7"
313313
def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,
314314
current_rate: float, current_profit: float, after_fill: bool,
315-
**kwargs) -> Optional[float]:
315+
**kwargs) -> float | None:
316316
# once the profit has risen above 10%, keep the stoploss at 7% above the open price
317317
if current_profit > 0.10:
318318
return stoploss_from_open(0.07, current_profit, is_short=trade.is_short)

0 commit comments

Comments
 (0)