Change missed calls to advise_* functions

This commit is contained in:
Matthias
2018-07-29 21:07:21 +02:00
parent 787d6042de
commit 2401fa15d2
6 changed files with 17 additions and 24 deletions

View File

@@ -13,18 +13,11 @@ import numpy # noqa
# This class is a sample. Feel free to customize it.
class TestStrategyLegacy(IStrategy):
"""
This is a test strategy to inspire you.
More information in https://github.com/freqtrade/freqtrade/blob/develop/docs/bot-optimization.md
This is a test strategy using the legacy function headers, which will be
removed in a future update.
Please do not use this as a template, but refer to user_data/strategy/TestStrategy.py
for a uptodate version of this template.
You can:
- Rename the class name (Do not forget to update class_name)
- Add any methods you want to build your strategy
- Add any lib you need to build your strategy
You must keep:
- the lib in the section "Do not remove these libs"
- the prototype for the methods: minimal_roi, stoploss, populate_indicators, populate_buy_trend,
populate_sell_trend, hyperopt_space, buy_strategy_generator
"""
# Minimal ROI designed for the strategy.

View File

@@ -25,11 +25,11 @@ def test_default_strategy_structure():
def test_default_strategy(result):
strategy = DefaultStrategy({})
pair = 'ETH/BTC'
metadata = {'pair': 'ETH/BTC'}
assert type(strategy.minimal_roi) is dict
assert type(strategy.stoploss) is float
assert type(strategy.ticker_interval) is str
indicators = strategy.populate_indicators(result, pair)
indicators = strategy.populate_indicators(result, metadata)
assert type(indicators) is DataFrame
assert type(strategy.populate_buy_trend(indicators, pair)) is DataFrame
assert type(strategy.populate_sell_trend(indicators, pair)) is DataFrame
assert type(strategy.populate_buy_trend(indicators, metadata)) is DataFrame
assert type(strategy.populate_sell_trend(indicators, metadata)) is DataFrame

View File

@@ -59,8 +59,8 @@ def test_search_strategy():
def test_load_strategy(result):
resolver = StrategyResolver({'strategy': 'TestStrategy'})
pair = 'ETH/BTC'
assert 'adx' in resolver.strategy.advise_indicators(result, metadata=pair)
metadata = {'pair': 'ETH/BTC'}
assert 'adx' in resolver.strategy.advise_indicators(result, metadata=metadata)
def test_load_strategy_invalid_directory(result, caplog):
@@ -74,7 +74,7 @@ def test_load_strategy_invalid_directory(result, caplog):
'Path "{}" does not exist'.format(extra_dir),
) in caplog.record_tuples
assert 'adx' in resolver.strategy.advise_indicators(result, 'ETH/BTC')
assert 'adx' in resolver.strategy.advise_indicators(result, {'pair': 'ETH/BTC'})
def test_load_not_found_strategy():