From 935ed36433608a2beb3dabc15274171a3eb93d29 Mon Sep 17 00:00:00 2001 From: Eugene Schava Date: Thu, 20 May 2021 01:10:22 +0300 Subject: [PATCH] day/week options for Telegram '/profit' command mypy fix --- freqtrade/rpc/telegram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/freqtrade/rpc/telegram.py b/freqtrade/rpc/telegram.py index ee7493938..ebd1eacb2 100644 --- a/freqtrade/rpc/telegram.py +++ b/freqtrade/rpc/telegram.py @@ -5,7 +5,7 @@ This module manage Telegram communication """ import json import logging -from datetime import datetime, timedelta +from datetime import datetime, date, timedelta from html import escape from itertools import chain from typing import Any, Callable, Dict, List, Union @@ -425,9 +425,9 @@ class Telegram(RPCHandler): start_date = datetime.fromtimestamp(0) if context.args: if 'day' in context.args: - start_date = datetime.utcnow().date() + start_date = datetime.combine(date.today(), datetime.min.time()) elif 'week' in context.args: - start_date = datetime.utcnow().date() - timedelta(days=7) + start_date = datetime.combine(date.today(), datetime.min.time()) - timedelta(days=7) stats = self._rpc._rpc_trade_statistics( stake_cur,