Remove SPOT_ candletype
This commit is contained in:
@@ -11,8 +11,7 @@ from pandas import DataFrame
|
||||
from freqtrade.configuration import TimeRange
|
||||
from freqtrade.data.dataprovider import DataProvider
|
||||
from freqtrade.data.history import load_data
|
||||
from freqtrade.enums import SellType
|
||||
from freqtrade.enums.signaltype import SignalDirection
|
||||
from freqtrade.enums import SellType, SignalDirection
|
||||
from freqtrade.exceptions import OperationalException, StrategyError
|
||||
from freqtrade.optimize.space import SKDecimal
|
||||
from freqtrade.persistence import PairLocks, Trade
|
||||
|
@@ -152,18 +152,18 @@ def test_informative_decorator(mocker, default_conf):
|
||||
test_data_30m = generate_test_data('30m', 40)
|
||||
test_data_1h = generate_test_data('1h', 40)
|
||||
data = {
|
||||
('XRP/USDT', '5m', CandleType.SPOT_): test_data_5m,
|
||||
('XRP/USDT', '30m', CandleType.SPOT_): test_data_30m,
|
||||
('XRP/USDT', '1h', CandleType.SPOT_): test_data_1h,
|
||||
('LTC/USDT', '5m', CandleType.SPOT_): test_data_5m,
|
||||
('LTC/USDT', '30m', CandleType.SPOT_): test_data_30m,
|
||||
('LTC/USDT', '1h', CandleType.SPOT_): test_data_1h,
|
||||
('NEO/USDT', '30m', CandleType.SPOT_): test_data_30m,
|
||||
('NEO/USDT', '5m', CandleType.SPOT_): test_data_5m,
|
||||
('NEO/USDT', '1h', CandleType.SPOT_): test_data_1h,
|
||||
('ETH/USDT', '1h', CandleType.SPOT_): test_data_1h,
|
||||
('ETH/USDT', '30m', CandleType.SPOT_): test_data_30m,
|
||||
('ETH/BTC', '1h', CandleType.SPOT_): test_data_1h,
|
||||
('XRP/USDT', '5m', CandleType.SPOT): test_data_5m,
|
||||
('XRP/USDT', '30m', CandleType.SPOT): test_data_30m,
|
||||
('XRP/USDT', '1h', CandleType.SPOT): test_data_1h,
|
||||
('LTC/USDT', '5m', CandleType.SPOT): test_data_5m,
|
||||
('LTC/USDT', '30m', CandleType.SPOT): test_data_30m,
|
||||
('LTC/USDT', '1h', CandleType.SPOT): test_data_1h,
|
||||
('NEO/USDT', '30m', CandleType.SPOT): test_data_30m,
|
||||
('NEO/USDT', '5m', CandleType.SPOT): test_data_5m,
|
||||
('NEO/USDT', '1h', CandleType.SPOT): test_data_1h,
|
||||
('ETH/USDT', '1h', CandleType.SPOT): test_data_1h,
|
||||
('ETH/USDT', '30m', CandleType.SPOT): test_data_30m,
|
||||
('ETH/BTC', '1h', CandleType.SPOT): test_data_1h,
|
||||
}
|
||||
from .strats.informative_decorator_strategy import InformativeDecoratorTest
|
||||
default_conf['stake_currency'] = 'USDT'
|
||||
@@ -176,25 +176,26 @@ def test_informative_decorator(mocker, default_conf):
|
||||
|
||||
assert len(strategy._ft_informative) == 6 # Equal to number of decorators used
|
||||
informative_pairs = [
|
||||
('XRP/USDT', '1h', CandleType.SPOT_),
|
||||
('LTC/USDT', '1h', CandleType.SPOT_),
|
||||
('XRP/USDT', '30m', CandleType.SPOT_),
|
||||
('LTC/USDT', '30m', CandleType.SPOT_),
|
||||
('NEO/USDT', '1h', CandleType.SPOT_),
|
||||
('NEO/USDT', '30m', CandleType.SPOT_),
|
||||
('NEO/USDT', '5m', CandleType.SPOT_),
|
||||
('ETH/BTC', '1h', CandleType.SPOT_),
|
||||
('ETH/USDT', '30m', CandleType.SPOT_)]
|
||||
('XRP/USDT', '1h', CandleType.SPOT),
|
||||
('LTC/USDT', '1h', CandleType.SPOT),
|
||||
('XRP/USDT', '30m', CandleType.SPOT),
|
||||
('LTC/USDT', '30m', CandleType.SPOT),
|
||||
('NEO/USDT', '1h', CandleType.SPOT),
|
||||
('NEO/USDT', '30m', CandleType.SPOT),
|
||||
('NEO/USDT', '5m', CandleType.SPOT),
|
||||
('ETH/BTC', '1h', CandleType.SPOT),
|
||||
('ETH/USDT', '30m', CandleType.SPOT)]
|
||||
for inf_pair in informative_pairs:
|
||||
assert inf_pair in strategy.gather_informative_pairs()
|
||||
|
||||
def test_historic_ohlcv(pair, timeframe, candle_type):
|
||||
return data[(pair, timeframe or strategy.timeframe, candle_type)].copy()
|
||||
return data[
|
||||
(pair, timeframe or strategy.timeframe, CandleType.from_string(candle_type))].copy()
|
||||
mocker.patch('freqtrade.data.dataprovider.DataProvider.historic_ohlcv',
|
||||
side_effect=test_historic_ohlcv)
|
||||
|
||||
analyzed = strategy.advise_all_indicators(
|
||||
{p: data[(p, strategy.timeframe, CandleType.SPOT_)] for p in ('XRP/USDT', 'LTC/USDT')})
|
||||
{p: data[(p, strategy.timeframe, CandleType.SPOT)] for p in ('XRP/USDT', 'LTC/USDT')})
|
||||
expected_columns = [
|
||||
'rsi_1h', 'rsi_30m', # Stacked informative decorators
|
||||
'neo_usdt_rsi_1h', # NEO 1h informative
|
||||
|
Reference in New Issue
Block a user