Ensure bot_start is called when visualizing results
This commit is contained in:
parent
485a074674
commit
f73d2a5371
@ -1193,6 +1193,7 @@ class RPC:
|
|||||||
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
from freqtrade.resolvers.strategy_resolver import StrategyResolver
|
||||||
strategy = StrategyResolver.load_strategy(config)
|
strategy = StrategyResolver.load_strategy(config)
|
||||||
strategy.dp = DataProvider(config, exchange=exchange, pairlists=None)
|
strategy.dp = DataProvider(config, exchange=exchange, pairlists=None)
|
||||||
|
strategy.ft_bot_start()
|
||||||
|
|
||||||
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})
|
df_analyzed = strategy.analyze_ticker(_data[pair], {'pair': pair})
|
||||||
|
|
||||||
|
@ -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
|
ftbot, client = botclient
|
||||||
timeframe = '5m'
|
timeframe = '5m'
|
||||||
|
lfm = mocker.patch('freqtrade.strategy.interface.IStrategy.load_freqAI_model')
|
||||||
# No pair
|
# No pair
|
||||||
rc = client_get(client,
|
rc = client_get(client,
|
||||||
f"{BASE_URI}/pair_history?timeframe={timeframe}"
|
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 len(rc.json()['data']) == rc.json()['length']
|
||||||
assert 'columns' in rc.json()
|
assert 'columns' in rc.json()
|
||||||
assert 'data' in rc.json()
|
assert 'data' in rc.json()
|
||||||
|
assert lfm.call_count == 1
|
||||||
assert rc.json()['pair'] == 'UNITTEST/BTC'
|
assert rc.json()['pair'] == 'UNITTEST/BTC'
|
||||||
assert rc.json()['strategy'] == CURRENT_TEST_STRATEGY
|
assert rc.json()['strategy'] == CURRENT_TEST_STRATEGY
|
||||||
assert rc.json()['data_start'] == '2018-01-11 00:00:00+00:00'
|
assert rc.json()['data_start'] == '2018-01-11 00:00:00+00:00'
|
||||||
|
Loading…
Reference in New Issue
Block a user