Merge pull request #1546 from hroff-1902/patch-4

OHLCV should be float for TA-LIB indicators in the strategy
This commit is contained in:
Misagh 2019-02-10 20:39:45 +01:00 committed by GitHub
commit 624ce6707a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,12 @@ def parse_ticker_dataframe(ticker: list, ticker_interval: str,
utc=True,
infer_datetime_format=True)
# Some exchanges return int values for volume and even for ohlc.
# Convert them since TA-LIB indicators used in the strategy assume floats
# and fail with exception...
frame = frame.astype(dtype={'open': 'float', 'high': 'float', 'low': 'float', 'close': 'float',
'volume': 'float'})
# group by index and aggregate results to eliminate duplicate ticks
frame = frame.groupby(by='date', as_index=False, sort=True).agg({
'open': 'first',