From 3bcb47d75d33d57885babee10bbac1c3a8af8e1c Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 11 Aug 2022 06:34:12 +0200 Subject: [PATCH] Remove usage of Decimal --- freqtrade/freqtradebot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 0dbeb2e44..e3ef01dd5 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -5,7 +5,6 @@ import copy import logging import traceback from datetime import datetime, time, timedelta, timezone -from decimal import Decimal from math import isclose from threading import Lock from typing import Any, Dict, List, Optional, Tuple @@ -33,6 +32,7 @@ from freqtrade.resolvers import ExchangeResolver, StrategyResolver from freqtrade.rpc import RPCManager from freqtrade.strategy.interface import IStrategy from freqtrade.strategy.strategy_wrapper import strategy_safe_wrapper +from freqtrade.util import FtPrecise from freqtrade.wallets import Wallets @@ -565,7 +565,7 @@ class FreqtradeBot(LoggingMixin): if stake_amount is not None and stake_amount < 0.0: # We should decrease our position - amount = abs(float(Decimal(stake_amount) / Decimal(current_exit_rate))) + amount = abs(float(FtPrecise(stake_amount) / FtPrecise(current_exit_rate))) if amount > trade.amount: # This is currently ineffective as remaining would become < min tradable # Fixing this would require checking for 0.0 there -