only return data['result'] from get_ticker_history
This commit is contained in:
parent
472ce8566d
commit
60e651cb4c
@ -83,7 +83,7 @@ def analyze_ticker(pair: str) -> DataFrame:
|
||||
"""
|
||||
minimum_date = arrow.utcnow().shift(hours=-24)
|
||||
data = get_ticker_history(pair, minimum_date)
|
||||
dataframe = parse_ticker_dataframe(data['result'])
|
||||
dataframe = parse_ticker_dataframe(data)
|
||||
|
||||
if dataframe.empty:
|
||||
logger.warning('Empty dataframe for pair %s', pair)
|
||||
|
@ -96,7 +96,7 @@ def get_ticker(pair: str) -> dict:
|
||||
return _API.get_ticker(pair)
|
||||
|
||||
|
||||
def get_ticker_history(pair: str, minimum_date: arrow.Arrow):
|
||||
def get_ticker_history(pair: str, minimum_date: arrow.Arrow) -> List:
|
||||
return _API.get_ticker_history(pair, minimum_date)
|
||||
|
||||
|
||||
|
@ -105,7 +105,7 @@ class Bittrex(Exchange):
|
||||
message=data['message'],
|
||||
pair=pair,
|
||||
minimum_date=minimum_date))
|
||||
return data
|
||||
return data['result']
|
||||
|
||||
def get_order(self, order_id: str) -> Dict:
|
||||
data = _API.get_order(order_id)
|
||||
|
@ -85,27 +85,23 @@ class Exchange(ABC):
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def get_ticker_history(self, pair: str, minimum_date: Optional[arrow.Arrow] = None) -> dict:
|
||||
def get_ticker_history(self, pair: str, minimum_date: Optional[arrow.Arrow] = None) -> List:
|
||||
"""
|
||||
Gets ticker history for given pair.
|
||||
:param pair: Pair as str, format: BTC_ETC
|
||||
:param minimum_date: Minimum date (optional)
|
||||
:return: dict, format: {
|
||||
'success': bool,
|
||||
'message': str,
|
||||
'result': [
|
||||
{
|
||||
'O': float, (Open)
|
||||
'H': float, (High)
|
||||
'L': float, (Low)
|
||||
'C': float, (Close)
|
||||
'V': float, (Volume)
|
||||
'T': datetime, (Time)
|
||||
'BV': float, (Base Volume)
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
:return: list, format: [
|
||||
{
|
||||
'O': float, (Open)
|
||||
'H': float, (High)
|
||||
'L': float, (Low)
|
||||
'C': float, (Close)
|
||||
'V': float, (Volume)
|
||||
'T': datetime, (Time)
|
||||
'BV': float, (Base Volume)
|
||||
},
|
||||
...
|
||||
]
|
||||
"""
|
||||
|
||||
def get_order(self, order_id: str) -> Dict:
|
||||
|
@ -11,9 +11,7 @@ from freqtrade.analyze import parse_ticker_dataframe, populate_buy_trend, popula
|
||||
@pytest.fixture
|
||||
def result():
|
||||
with open('freqtrade/tests/testdata/btc-eth.json') as data_file:
|
||||
data = json.load(data_file)
|
||||
|
||||
return parse_ticker_dataframe(data['result'])
|
||||
return parse_ticker_dataframe(json.load(data_file))
|
||||
|
||||
|
||||
def test_dataframe_has_correct_columns(result):
|
||||
|
2
freqtrade/tests/testdata/btc-edg.json
vendored
2
freqtrade/tests/testdata/btc-edg.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-etc.json
vendored
2
freqtrade/tests/testdata/btc-etc.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-eth.json
vendored
2
freqtrade/tests/testdata/btc-eth.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-ltc.json
vendored
2
freqtrade/tests/testdata/btc-ltc.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-mtl.json
vendored
2
freqtrade/tests/testdata/btc-mtl.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-neo.json
vendored
2
freqtrade/tests/testdata/btc-neo.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-omg.json
vendored
2
freqtrade/tests/testdata/btc-omg.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-pay.json
vendored
2
freqtrade/tests/testdata/btc-pay.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-pivx.json
vendored
2
freqtrade/tests/testdata/btc-pivx.json
vendored
File diff suppressed because one or more lines are too long
2
freqtrade/tests/testdata/btc-qtum.json
vendored
2
freqtrade/tests/testdata/btc-qtum.json
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user