OHLC fix
This commit is contained in:
@@ -152,7 +152,7 @@ def update_ohlc(prev: NativeOHLC, period: timedelta, time: datetime, price: Opti
|
|||||||
returns an ordered list of OHLC's that have been created/modified by the new time/price
|
returns an ordered list of OHLC's that have been created/modified by the new time/price
|
||||||
if price is None, then bars are advanced based on the time but no new price is added to the series.
|
if price is None, then bars are advanced based on the time but no new price is added to the series.
|
||||||
"""
|
"""
|
||||||
log.debug(f'\tupdating {prev} with {minutely(time)} {price}')
|
# log.debug(f'\tupdating {prev} with {minutely(time)} {price}')
|
||||||
cur = prev
|
cur = prev
|
||||||
if time < cur.start:
|
if time < cur.start:
|
||||||
# data corruption. just shut down
|
# data corruption. just shut down
|
||||||
@@ -171,7 +171,7 @@ def update_ohlc(prev: NativeOHLC, period: timedelta, time: datetime, price: Opti
|
|||||||
cur.update(price)
|
cur.update(price)
|
||||||
result.append(cur)
|
result.append(cur)
|
||||||
# log.debug(f'\tappended current bar: {cur.ohlc}')
|
# log.debug(f'\tappended current bar: {cur.ohlc}')
|
||||||
log.debug(f'\tupdate result: {result}')
|
# log.debug(f'\tupdate result: {result}')
|
||||||
return result
|
return result
|
||||||
|
|
||||||
class OHLCKey (NamedTuple):
|
class OHLCKey (NamedTuple):
|
||||||
|
|||||||
Reference in New Issue
Block a user