Decouple strategy from analyse.py

This commit is contained in:
Gerald Lonlas
2018-01-15 00:35:11 -08:00
parent f7e979f3ba
commit c46d78b4b9
16 changed files with 839 additions and 327 deletions

View File

@@ -9,6 +9,7 @@ from pandas import DataFrame
from freqtrade.analyze import (get_signal, parse_ticker_dataframe,
populate_buy_trend, populate_indicators,
populate_sell_trend)
from freqtrade.strategy.strategy import Strategy
@pytest.fixture
@@ -27,11 +28,17 @@ def test_dataframe_correct_length(result):
def test_populates_buy_trend(result):
# Load the default strategy for the unit test, because this logic is done in main.py
Strategy().init({'strategy': 'default_strategy'})
dataframe = populate_buy_trend(populate_indicators(result))
assert 'buy' in dataframe.columns
def test_populates_sell_trend(result):
# Load the default strategy for the unit test, because this logic is done in main.py
Strategy().init({'strategy': 'default_strategy'})
dataframe = populate_sell_trend(populate_indicators(result))
assert 'sell' in dataframe.columns