From d3b9f4d393850de9d846735d8790d32dbc459c4c Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 30 Apr 2020 19:28:36 +0200 Subject: [PATCH] Add extract_cost_curr_rate --- freqtrade/freqtradebot.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 4db9f9a1c..7963fbec3 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -1177,6 +1177,15 @@ class FreqtradeBot: and order['fee']['cost'] is not None ) + def _extract_cost_curr_rate(self, order: Dict) -> Tuple[float, str, float]: + """ + :param order: Order or trade (one trade) dict + :return: Tuple with cost, currency, rate of the given fee dict + """ + return (order['fee']['cost'], + order['fee']['currency'], + order['fee'].get('rate', None)) + def get_real_amount(self, trade: Trade, order: Dict, order_amount: float = None) -> float: """ Get real amount for the trade