@@ -527,7 +527,7 @@ class AwesomeStrategy(IStrategy):
527527
528528 # ... populate_* methods
529529
530- def custom_roi (self , pair : str , trade : Trade, current_time : datetime,
530+ def custom_roi (self , pair : str , trade : Trade, current_time : datetime, trade_duration : int ,
531531 entry_tag : str | None , side : str , ** kwargs ) -> float | None :
532532 """
533533 Custom ROI logic, returns a new minimum ROI threshold (as a ratio, e.g., 0.05 for +5%).
@@ -540,6 +540,7 @@ class AwesomeStrategy(IStrategy):
540540 :param pair: Pair that's currently analyzed.
541541 :param trade: trade object.
542542 :param current_time: datetime object, containing the current datetime.
543+ :param trade_duration: Current trade duration in minutes.
543544 :param entry_tag: Optional entry_tag (buy_tag) if provided with the buy signal.
544545 :param side: 'long' or 'short' - indicating the direction of the current trade.
545546 :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
@@ -561,7 +562,7 @@ class AwesomeStrategy(IStrategy):
561562
562563 # ... populate_* methods
563564
564- def custom_roi (self , pair : str , trade : Trade, current_time : datetime,
565+ def custom_roi (self , pair : str , trade : Trade, current_time : datetime, trade_duration : int ,
565566 entry_tag : str | None , side : str , ** kwargs ) -> float | None :
566567
567568 stake = trade.stake_currency
@@ -587,7 +588,7 @@ class AwesomeStrategy(IStrategy):
587588
588589 # ... populate_* methods
589590
590- def custom_roi (self , pair : str , trade : Trade, current_time : datetime,
591+ def custom_roi (self , pair : str , trade : Trade, current_time : datetime, trade_duration : int ,
591592 entry_tag : str | None , side : str , ** kwargs ) -> float | None :
592593
593594 roi_by_tag = {
@@ -616,7 +617,7 @@ class AwesomeStrategy(IStrategy):
616617 # <...>
617618 dataframe[" atr" ] = ta.ATR(dataframe, timeperiod = 10 )
618619
619- def custom_roi (self , pair : str , trade : Trade, current_time : datetime,
620+ def custom_roi (self , pair : str , trade : Trade, current_time : datetime, trade_duration : int ,
620621 entry_tag : str | None , side : str , ** kwargs ) -> float | None :
621622
622623 dataframe, _ = self .dp.get_analyzed_dataframe(pair, self .timeframe)
0 commit comments