Guard against no time field in some provider quotes
parent
5952e7f538
commit
8118a57b9a
|
@ -24,7 +24,10 @@ from typing import AsyncIterator
|
|||
|
||||
def iterticks(
|
||||
quote: dict,
|
||||
types: tuple[str] = ('trade', 'dark_trade'),
|
||||
types: tuple[str] = (
|
||||
'trade',
|
||||
'dark_trade',
|
||||
),
|
||||
deduplicate_darks: bool = False,
|
||||
|
||||
) -> AsyncIterator:
|
||||
|
@ -47,8 +50,11 @@ def iterticks(
|
|||
if deduplicate_darks:
|
||||
for tick in ticks:
|
||||
ttype = tick.get('type')
|
||||
|
||||
time = tick.get('time', None)
|
||||
if time:
|
||||
sig = (
|
||||
tick['time'],
|
||||
time,
|
||||
tick['price'],
|
||||
tick['size']
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue