From 96168d8d6fe1966cd4b14c27350d7b74425e118c Mon Sep 17 00:00:00 2001 From: Mark Veidemanis Date: Thu, 17 Feb 2022 23:24:12 +0000 Subject: [PATCH] Differentiate between trades+profit and profit in ES --- handler/transactions.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/handler/transactions.py b/handler/transactions.py index 5b7ca1c..77f9643 100644 --- a/handler/transactions.py +++ b/handler/transactions.py @@ -552,9 +552,15 @@ class Transactions(object): total_usd += trades_usd profit = total_usd - float(settings.Money.BaseUSD) - cast_es = { - "profit_usd": profit, - } + if trades: + cast_es = { + "profit_trades_usd": profit, + } + else: + cast_es = { + "profit_usd": profit, + } + self.write_to_es("get_profit", cast_es) return profit