diff --git a/README.md b/README.md index 8cba78136..78ea3cecd 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,8 @@ hesitate to read the source code and understand the mechanism of this bot. Please read the [exchange specific notes](docs/exchanges.md) to learn about eventual, special configurations needed for each exchange. +- [X] [Binance](https://www.binance.com/) ([*Note for binance users](docs/exchanges.md#binance-blacklist)) - [X] [Bittrex](https://bittrex.com/) -- [X] [Binance](https://www.binance.com/) ([*Note for binance users](docs/exchanges.md#blacklists)) - [X] [Kraken](https://kraken.com/) - [X] [FTX](https://ftx.com) - [ ] [potentially many others](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_ diff --git a/config_examples/config_full.example.json b/config_examples/config_full.example.json index d404391a4..3ca413281 100644 --- a/config_examples/config_full.example.json +++ b/config_examples/config_full.example.json @@ -78,33 +78,6 @@ "refresh_period": 1440 } ], - "protections": [ - { - "method": "StoplossGuard", - "lookback_period_candles": 60, - "trade_limit": 4, - "stop_duration_candles": 60, - "only_per_pair": false - }, - { - "method": "CooldownPeriod", - "stop_duration_candles": 20 - }, - { - "method": "MaxDrawdown", - "lookback_period_candles": 200, - "trade_limit": 20, - "stop_duration_candles": 10, - "max_allowed_drawdown": 0.2 - }, - { - "method": "LowProfitPairs", - "lookback_period_candles": 360, - "trade_limit": 1, - "stop_duration_candles": 2, - "required_profit": 0.02 - } - ], "exchange": { "name": "binance", "sandbox": false, diff --git a/docs/index.md b/docs/index.md index 8077cd303..05eaa7552 100644 --- a/docs/index.md +++ b/docs/index.md @@ -36,7 +36,7 @@ Freqtrade is a crypto-currency algorithmic trading software developed in python Please read the [exchange specific notes](exchanges.md) to learn about eventual, special configurations needed for each exchange. -- [X] [Binance](https://www.binance.com/) ([*Note for binance users](exchanges.md#blacklists)) +- [X] [Binance](https://www.binance.com/) ([*Note for binance users](docs/exchanges.md#binance-blacklist)) - [X] [Bittrex](https://bittrex.com/) - [X] [FTX](https://ftx.com) - [X] [Kraken](https://kraken.com/) diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 4c0e1c8a9..941f52bf6 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -325,10 +325,10 @@ class IStrategy(ABC, HyperStrategyMixin): time. This method is not called when sell signal is set. This method should be overridden to create sell signals that depend on trade parameters. For - example you could implement a stoploss relative to candle when trade was opened, or a custom - 1:2 risk-reward ROI. + example you could implement a sell relative to the candle when the trade was opened, + or a custom 1:2 risk-reward ROI. - Custom sell reason max length is 64. Exceeding this limit will raise OperationalException. + Custom sell reason max length is 64. Exceeding characters will be removed. :param pair: Pair that's currently analyzed :param trade: trade object. diff --git a/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 b/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 index 2a9ac0690..2df23f365 100644 --- a/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 +++ b/freqtrade/templates/subtemplates/strategy_methods_advanced.j2 @@ -12,6 +12,23 @@ def bot_loop_start(self, **kwargs) -> None: """ pass +def custom_stake_amount(self, pair: str, current_time: 'datetime', current_rate: float, + proposed_stake: float, min_stake: float, max_stake: float, + **kwargs) -> float: + """ + Customize stake size for each new trade. This method is not called when edge module is + enabled. + + :param pair: Pair that's currently analyzed + :param current_time: datetime object, containing the current datetime + :param current_rate: Rate, calculated based on pricing settings in ask_strategy. + :param proposed_stake: A stake amount proposed by the bot. + :param min_stake: Minimal stake size allowed by exchange. + :param max_stake: Balance available for trading. + :return: A stake size, which is between min_stake and max_stake. + """ + return proposed_stake + use_custom_stoploss = True def custom_stoploss(self, pair: str, trade: 'Trade', current_time: 'datetime', @@ -38,6 +55,30 @@ def custom_stoploss(self, pair: str, trade: 'Trade', current_time: 'datetime', """ return self.stoploss +def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, + current_profit: float, **kwargs) -> 'Optional[Union[str, bool]]': + """ + Custom sell signal logic indicating that specified position should be sold. Returning a + string or True from this method is equal to setting sell signal on a candle at specified + time. This method is not called when sell signal is set. + + This method should be overridden to create sell signals that depend on trade parameters. For + example you could implement a sell relative to the candle when the trade was opened, + or a custom 1:2 risk-reward ROI. + + Custom sell reason max length is 64. Exceeding characters will be removed. + + :param pair: Pair that's currently analyzed + :param trade: trade object. + :param current_time: datetime object, containing the current datetime + :param current_rate: Rate, calculated based on pricing settings in ask_strategy. + :param current_profit: Current profit (as ratio), calculated based on current_rate. + :param **kwargs: Ensure to keep this here so updates to this won't break your strategy. + :return: To execute sell, return a string with custom sell reason or True. Otherwise return + None or False. + """ + return None + def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: 'datetime', **kwargs) -> bool: """