updating ‘close’ price of last candle with ‘open’ price of partial

candle
This commit is contained in:
misagh 2018-09-28 20:23:30 +02:00
parent 89b515be60
commit 4509271e56

View File

@ -15,6 +15,13 @@ def parse_ticker_dataframe(ticker: list) -> DataFrame:
:return: DataFrame
"""
cols = ['date', 'open', 'high', 'low', 'close', 'volume']
# Sometimes the newly open candle "open price" is different from
# the complete candle "close price". we should consider the
# partial candle open price as the close price for last
# complete candle
ticker[-2][4] = ticker[-1][1]
frame = DataFrame(ticker, columns=cols)
frame['date'] = to_datetime(frame['date'],