stable/freqtrade
Théo Martin 1283f8cfd4
Correct get_min_pair_stake_amount formula
If I understand well, the goal is to have stoploss price above the minimum required by the exchange, which is not what has been achieved so far.
Only if amount_reserve_percent = (1 + pad) / (1 - abs(stoploss)) we get final stake amount * (1 - abs(stoploss)) > minimum required.

Here is a code example, with numbers from the example in the doc for this function:

stoploss = 0.1
padding = 0.05
min_required_exchange_cost = 10
min_required_exchange_amount = 12
min_required_exchange = max(min_required_exchange_cost, min_required_exchange_amount)
min_required_with_padding = min_required_exchange * (1 + padding)

min_stake_amount = min_required_exchange * max(min(padding + stoploss + 1, 1.5), 1)
stoploss_price = min_stake_amount*(1-stoploss)
print(f'[OLD LOGIC] stoploss_price ({stoploss_price}) < min_required_with_padding ({min_required_with_padding})')


min_stake_amount = min_required_exchange * max(min((1+padding) / (1-stoploss), 1.5), 1)
stoploss_price = min_stake_amount*(1-stoploss)
print(f'[NEW LOGIC] stoploss_price ({stoploss_price}) > min_required_with_padding ({min_required_with_padding})')
2021-04-15 00:33:05 +01:00
..
commands Merge pull request #4697 from freqtrade/docker_user 2021-04-10 08:19:25 +02:00
configuration Merge pull request #4697 from freqtrade/docker_user 2021-04-10 08:19:25 +02:00
data Return a copy from current_whitelist 2021-04-13 06:49:53 +02:00
edge Allow edge to use dynamic pairlists 2021-03-30 20:20:24 +02:00
exchange Correct get_min_pair_stake_amount formula 2021-04-15 00:33:05 +01:00
mixins Improve wording, fix bug 2020-12-07 15:48:06 +01:00
optimize Don't use _set_value for autoOpt-Spaces 2021-04-10 09:53:48 +02:00
persistence Remove arrow from models.py 2021-04-13 11:55:03 +02:00
plot Use absolute drawdown calc 2021-02-27 09:32:59 +01:00
plugins Merge pull request #4686 from gerrito333/develop 2021-04-08 20:00:41 +02:00
resolvers Refactor the comparison involving not 2021-04-02 16:57:44 +05:30
rpc /balance should use cached tickers when possible 2021-04-13 20:21:03 +02:00
strategy Don't use _set_value for autoOpt-Spaces 2021-04-10 09:53:48 +02:00
templates Fix typo 2021-04-03 19:56:20 +02:00
vendor Apply isort to freqtrade codebase 2020-09-28 19:40:46 +02:00
__init__.py fix typo in comment 2020-04-14 08:05:46 +02:00
__main__.py Remove support for 3.6 2020-12-14 19:18:54 +01:00
constants.py Merge pull request #4686 from gerrito333/develop 2021-04-08 20:00:41 +02:00
exceptions.py Introduce insufficientFunds Exception 2020-08-14 09:56:48 +02:00
freqtradebot.py Reduce log verbosity when buying 2021-04-10 14:40:44 +02:00
loggers.py Fix double logging 2020-11-25 14:31:34 +01:00
main.py Remove support for 3.6 2020-12-14 19:18:54 +01:00
misc.py Allow comments in pairs files 2021-04-06 13:29:22 +02:00
state.py reload_conf & reload_config now both accepted, code is more consistent now 2020-06-10 19:28:02 +02:00
wallets.py Add check to ensure close_profit_abs is filled on closed trades 2021-03-16 19:24:03 +01:00
worker.py Apply isort to freqtrade codebase 2020-09-28 19:40:46 +02:00