Skip to content

Commit

Permalink
Merge pull request freqtrade#3589 from freqtrade/api/timeframe_ms
Browse files Browse the repository at this point in the history
[minor] Send timeframe min and ms in show_config response
  • Loading branch information
hroff-1902 authored Jul 13, 2020
2 parents c2acf4b + 01f325a commit 43a1fe6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions freqtrade/rpc/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
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
Expand Down Expand Up @@ -103,6 +105,8 @@ def _rpc_show_config(self) -> Dict[str, Any]:
'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),
Expand Down
2 changes: 2 additions & 0 deletions tests/rpc/test_rpc_apiserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43a1fe6

Please sign in to comment.