Add tests for advise_indicator methods
This commit is contained in:
@@ -9,7 +9,6 @@ from freqtrade.strategy import import_strategy
|
||||
from freqtrade.strategy.default_strategy import DefaultStrategy
|
||||
from freqtrade.strategy.interface import IStrategy
|
||||
from freqtrade.strategy.resolver import StrategyResolver
|
||||
from freqtrade.tests.conftest import log_has
|
||||
|
||||
|
||||
def test_import_strategy(caplog):
|
||||
@@ -73,7 +72,8 @@ def test_load_strategy_invalid_directory(result, caplog):
|
||||
logging.WARNING,
|
||||
'Path "{}" does not exist'.format(extra_dir),
|
||||
) in caplog.record_tuples
|
||||
assert 'adx' in resolver.strategy.populate_indicators(result)
|
||||
|
||||
assert 'adx' in resolver.strategy.advise_indicators(result, 'ETH/BTC')
|
||||
|
||||
|
||||
def test_load_not_found_strategy():
|
||||
@@ -88,7 +88,7 @@ def test_strategy(result):
|
||||
config = {'strategy': 'DefaultStrategy'}
|
||||
|
||||
resolver = StrategyResolver(config)
|
||||
|
||||
pair = 'ETH/BTC'
|
||||
assert resolver.strategy.minimal_roi[0] == 0.04
|
||||
assert config["minimal_roi"]['0'] == 0.04
|
||||
|
||||
@@ -98,12 +98,13 @@ def test_strategy(result):
|
||||
assert resolver.strategy.ticker_interval == '5m'
|
||||
assert config['ticker_interval'] == '5m'
|
||||
|
||||
assert 'adx' in resolver.strategy.populate_indicators(result)
|
||||
df_indicators = resolver.strategy.advise_indicators(result, pair=pair)
|
||||
assert 'adx' in df_indicators
|
||||
|
||||
dataframe = resolver.strategy.populate_buy_trend(resolver.strategy.populate_indicators(result))
|
||||
dataframe = resolver.strategy.advise_buy(df_indicators, pair=pair)
|
||||
assert 'buy' in dataframe.columns
|
||||
|
||||
dataframe = resolver.strategy.populate_sell_trend(resolver.strategy.populate_indicators(result))
|
||||
dataframe = resolver.strategy.advise_sell(df_indicators, pair='ETH/BTC')
|
||||
assert 'sell' in dataframe.columns
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user