Adding the pair name when populating indicators allowing the strategy to have customized context for a pair
This commit is contained in:
@@ -30,7 +30,7 @@ def test_default_strategy(result):
|
||||
assert type(strategy.minimal_roi) is dict
|
||||
assert type(strategy.stoploss) is float
|
||||
assert type(strategy.ticker_interval) is int
|
||||
indicators = strategy.populate_indicators(result)
|
||||
indicators = strategy.populate_indicators(result, None)
|
||||
assert type(indicators) is DataFrame
|
||||
assert type(strategy.populate_buy_trend(indicators)) is DataFrame
|
||||
assert type(strategy.populate_sell_trend(indicators)) is DataFrame
|
||||
assert type(strategy.populate_buy_trend(indicators, None)) is DataFrame
|
||||
assert type(strategy.populate_sell_trend(indicators, None)) is DataFrame
|
||||
|
@@ -37,7 +37,7 @@ def test_load_strategy(result):
|
||||
assert not hasattr(Strategy, 'custom_strategy')
|
||||
|
||||
assert hasattr(strategy.custom_strategy, 'populate_indicators')
|
||||
assert 'adx' in strategy.populate_indicators(result)
|
||||
assert 'adx' in strategy.populate_indicators(result, None)
|
||||
|
||||
|
||||
def test_strategy(result):
|
||||
@@ -51,14 +51,14 @@ def test_strategy(result):
|
||||
assert strategy.stoploss == -0.10
|
||||
|
||||
assert hasattr(strategy.custom_strategy, 'populate_indicators')
|
||||
assert 'adx' in strategy.populate_indicators(result)
|
||||
assert 'adx' in strategy.populate_indicators(result, None)
|
||||
|
||||
assert hasattr(strategy.custom_strategy, 'populate_buy_trend')
|
||||
dataframe = strategy.populate_buy_trend(strategy.populate_indicators(result))
|
||||
dataframe = strategy.populate_buy_trend(strategy.populate_indicators(result, None), None)
|
||||
assert 'buy' in dataframe.columns
|
||||
|
||||
assert hasattr(strategy.custom_strategy, 'populate_sell_trend')
|
||||
dataframe = strategy.populate_sell_trend(strategy.populate_indicators(result))
|
||||
dataframe = strategy.populate_sell_trend(strategy.populate_indicators(result, None), None)
|
||||
assert 'sell' in dataframe.columns
|
||||
|
||||
|
||||
|
@@ -26,7 +26,7 @@ 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))
|
||||
dataframe = populate_buy_trend(populate_indicators(result, None), None)
|
||||
assert 'buy' in dataframe.columns
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ 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))
|
||||
dataframe = populate_sell_trend(populate_indicators(result, None), None)
|
||||
assert 'sell' in dataframe.columns
|
||||
|
||||
|
||||
|
@@ -12,7 +12,7 @@ def load_dataframe_pair(pairs):
|
||||
assert isinstance(ld, dict)
|
||||
assert isinstance(pairs[0], str)
|
||||
dataframe = ld[pairs[0]]
|
||||
dataframe = analyze.analyze_ticker(dataframe)
|
||||
dataframe = analyze.analyze_ticker(dataframe, pairs[0])
|
||||
return dataframe
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user