From 454c2343a861d45f82f644bd29ad11ad9061d77d Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 14 Sep 2023 18:27:41 +0200 Subject: [PATCH] More clarity for adjust_trade_position callback docstring --- docs/strategy-callbacks.md | 7 ++++--- freqtrade/strategy/interface.py | 7 ++++--- .../strategy_methods_advanced.j2 | 11 ++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 5ce898dbb..6c86595d3 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -823,7 +823,7 @@ class DigDeeperStrategy(IStrategy): """ Custom trade adjustment logic, returning the stake amount that a trade should be increased or decreased. - This means extra buy or sell orders with additional fees. + This means extra entry or exit orders with additional fees. Only called when `position_adjustment_enable` is set to True. For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/ @@ -832,8 +832,9 @@ class DigDeeperStrategy(IStrategy): :param trade: trade object. :param current_time: datetime object, containing the current datetime - :param current_rate: Current buy rate. - :param current_profit: Current profit (as ratio), calculated based on current_rate. + :param current_rate: Current entry rate (same as current_entry_profit) + :param current_profit: Current profit (as ratio), calculated based on current_rate + (same as current_entry_profit). :param min_stake: Minimal stake size allowed by exchange (for both entries and exits) :param max_stake: Maximum stake allowed (either through balance, or by exchange limits). :param current_entry_rate: Current rate using entry pricing. diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 43d2a0baf..94c78f3c7 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -513,7 +513,7 @@ class IStrategy(ABC, HyperStrategyMixin): """ Custom trade adjustment logic, returning the stake amount that a trade should be increased or decreased. - This means extra buy or sell orders with additional fees. + This means extra entry or exit orders with additional fees. Only called when `position_adjustment_enable` is set to True. For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/ @@ -522,8 +522,9 @@ class IStrategy(ABC, HyperStrategyMixin): :param trade: trade object. :param current_time: datetime object, containing the current datetime - :param current_rate: Current buy rate. - :param current_profit: Current profit (as ratio), calculated based on current_rate. + :param current_rate: Current entry rate (same as current_entry_profit) + :param current_profit: Current profit (as ratio), calculated based on current_rate + (same as current_entry_profit). :param min_stake: Minimal stake size allowed by exchange (for both entries and exits) :param max_stake: Maximum stake allowed (either through balance, or by exchange limits). :param current_entry_rate: Current rate using entry pricing. diff --git a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 index 95c6df2ea..4e1875084 100644 --- a/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 +++ b/freqtrade/templates/strategy_subtemplates/strategy_methods_advanced.j2 @@ -257,7 +257,7 @@ def adjust_trade_position(self, trade: 'Trade', current_time: datetime, """ Custom trade adjustment logic, returning the stake amount that a trade should be increased or decreased. - This means extra buy or sell orders with additional fees. + This means extra entry or exit orders with additional fees. Only called when `position_adjustment_enable` is set to True. For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/ @@ -266,8 +266,9 @@ def adjust_trade_position(self, trade: 'Trade', current_time: datetime, :param trade: trade object. :param current_time: datetime object, containing the current datetime - :param current_rate: Current buy rate. - :param current_profit: Current profit (as ratio), calculated based on current_rate. + :param current_rate: Current entry rate (same as current_entry_profit) + :param current_profit: Current profit (as ratio), calculated based on current_rate + (same as current_entry_profit). :param min_stake: Minimal stake size allowed by exchange (for both entries and exits) :param max_stake: Maximum stake allowed (either through balance, or by exchange limits). :param current_entry_rate: Current rate using entry pricing. @@ -276,8 +277,8 @@ def adjust_trade_position(self, trade: 'Trade', current_time: datetime, :param current_exit_profit: Current profit using exit pricing. :param **kwargs: Ensure to keep this here so updates to this won't break your strategy. :return float: Stake amount to adjust your trade, - Positive values to increase position, Negative values to decrease position. - Return None for no action. + Positive values to increase position, Negative values to decrease position. + Return None for no action. """ return None