From 01f325a9e4cd65a0bb117f031f25d0da593002c9 Mon Sep 17 00:00:00 2001 From: Matthias Date: Mon, 13 Jul 2020 21:15:33 +0200 Subject: [PATCH] Send timeframe min and ms in show_config response --- freqtrade/rpc/rpc.py | 4 ++++ tests/rpc/test_rpc_apiserver.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index e0eb12d23..c73fcbf54 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -12,6 +12,8 @@ import arrow from numpy import NAN, mean from freqtrade.exceptions import ExchangeError, PricingError + +from freqtrade.exchange import timeframe_to_msecs, timeframe_to_minutes from freqtrade.misc import shorten_date from freqtrade.persistence import Trade from freqtrade.rpc.fiat_convert import CryptoToFiatConverter @@ -103,6 +105,8 @@ class RPC: 'trailing_only_offset_is_reached': config.get('trailing_only_offset_is_reached'), 'ticker_interval': config['timeframe'], # DEPRECATED 'timeframe': config['timeframe'], + 'timeframe_ms': timeframe_to_msecs(config['timeframe']), + 'timeframe_min': timeframe_to_minutes(config['timeframe']), 'exchange': config['exchange']['name'], 'strategy': config['strategy'], 'forcebuy_enabled': config.get('forcebuy_enable', False), diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 45aa57588..355b63f48 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -326,6 +326,8 @@ def test_api_show_config(botclient, mocker): assert rc.json['exchange'] == 'bittrex' assert rc.json['ticker_interval'] == '5m' assert rc.json['timeframe'] == '5m' + assert rc.json['timeframe_ms'] == 300000 + assert rc.json['timeframe_min'] == 5 assert rc.json['state'] == 'running' assert not rc.json['trailing_stop'] assert 'bid_strategy' in rc.json