Ensure bot_start is called when visualizing results

This commit is contained in:
Matthias 2023-04-10 14:47:59 +02:00
parent 485a074674
commit f73d2a5371
2 changed files with 4 additions and 2 deletions

View File

@ -1193,6 +1193,7 @@ class RPC:
from freqtrade.resolvers.strategy_resolver import StrategyResolver
strategy = StrategyResolver.load_strategy(config)
strategy.dp = DataProvider(config, exchange=exchange, pairlists=None)
strategy.ft_bot_start()
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})

View File

@ -1403,10 +1403,10 @@ def test_api_pair_candles(botclient, ohlcv_history):
])
def test_api_pair_history(botclient, ohlcv_history):
def test_api_pair_history(botclient, mocker):
ftbot, client = botclient
timeframe = '5m'
lfm = mocker.patch('freqtrade.strategy.interface.IStrategy.load_freqAI_model')
# No pair
rc = client_get(client,
f"{BASE_URI}/pair_history?timeframe={timeframe}"
@ -1440,6 +1440,7 @@ def test_api_pair_history(botclient, ohlcv_history):
assert len(rc.json()['data']) == rc.json()['length']
assert 'columns' in rc.json()
assert 'data' in rc.json()
assert lfm.call_count == 1
assert rc.json()['pair'] == 'UNITTEST/BTC'
assert rc.json()['strategy'] == CURRENT_TEST_STRATEGY
assert rc.json()['data_start'] == '2018-01-11 00:00:00+00:00'