From b084efdd06fcbedf64290e51f815e0f820cbbc0a Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 21 Sep 2024 16:24:56 +0200 Subject: [PATCH] feat: initialize trade objects with 0 amount This way, it'll represent the owned amount which will be updated once the order fills --- freqtrade/freqtradebot.py | 2 +- freqtrade/optimize/backtesting.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 0bc11e0fd..fe270f670 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -987,7 +987,7 @@ class FreqtradeBot(LoggingMixin): base_currency=base_currency, stake_currency=self.config["stake_currency"], stake_amount=stake_amount, - amount=amount, + amount=0, is_open=True, amount_requested=amount_requested, fee_open=fee, diff --git a/freqtrade/optimize/backtesting.py b/freqtrade/optimize/backtesting.py index 71adfbb4b..20116f670 100644 --- a/freqtrade/optimize/backtesting.py +++ b/freqtrade/optimize/backtesting.py @@ -1099,7 +1099,7 @@ class Backtesting: open_rate_requested=propose_rate, open_date=current_time, stake_amount=stake_amount, - amount=amount, + amount=0, amount_requested=amount, fee_open=self.fee, fee_close=self.fee,