mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
29 lines
1015 B
Python
29 lines
1015 B
Python
from pandas import DataFrame
|
|
|
|
from freqtrade.strategy.default_strategy import DefaultStrategy, class_name
|
|
|
|
|
|
def test_default_strategy_class_name():
|
|
assert class_name == DefaultStrategy.__name__
|
|
|
|
|
|
def test_default_strategy_structure():
|
|
assert hasattr(DefaultStrategy, 'minimal_roi')
|
|
assert hasattr(DefaultStrategy, 'stoploss')
|
|
assert hasattr(DefaultStrategy, 'ticker_interval')
|
|
assert hasattr(DefaultStrategy, 'populate_indicators')
|
|
assert hasattr(DefaultStrategy, 'populate_buy_trend')
|
|
assert hasattr(DefaultStrategy, 'populate_sell_trend')
|
|
|
|
|
|
def test_default_strategy(result):
|
|
strategy = DefaultStrategy()
|
|
|
|
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)
|
|
assert type(indicators) is DataFrame
|
|
assert type(strategy.populate_buy_trend(indicators)) is DataFrame
|
|
assert type(strategy.populate_sell_trend(indicators)) is DataFrame
|