diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 2b5eb107c..47651c540 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -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}) diff --git a/tests/rpc/test_rpc_apiserver.py b/tests/rpc/test_rpc_apiserver.py index 31075e514..698ccc5f3 100644 --- a/tests/rpc/test_rpc_apiserver.py +++ b/tests/rpc/test_rpc_apiserver.py @@ -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'