Backfill history gaps with pre-gap close

account_tests
Tyler Goodlet 2023-07-26 12:56:06 -04:00
parent 64329d44e7
commit 7802febd20
1 changed files with 12 additions and 2 deletions

View File

@ -140,8 +140,18 @@ async def shm_push_in_between(
# memory...
array = shm.array
zeros = array[array['low'] == 0]
if 0 < zeros.size < 1000:
await tractor.pause()
# always backfill gaps with the earliest (price) datum's
# value to avoid the y-ranger including zeros and completely
# stretching the y-axis..
if 0 < zeros.size:
zeros[[
'open',
'high',
'low',
'close',
]] = shm._array[zeros['index'][0] - 1]['close']
# await tractor.pause()
async def start_backfill(