Reset the clears table on zero size conditions

lifo_pps_ib
Tyler Goodlet 2022-06-22 18:54:23 -04:00
parent f9c4b3cc96
commit 566a54ffb6
1 changed files with 11 additions and 7 deletions

View File

@ -310,13 +310,17 @@ def update_pps(
cost=2*r.cost, cost=2*r.cost,
) )
# track clearing data if pp.size == 0:
pp.clears[r.tid] = { pp.clears.clear()
'cost': r.cost,
'price': r.price, else:
'size': r.size, # track clearing data
'dt': str(r.dt), pp.clears[r.tid] = {
} 'cost': r.cost,
'price': r.price,
'size': r.size,
'dt': str(r.dt),
}
assert len(set(pp.clears)) == len(pp.clears) assert len(set(pp.clears)) == len(pp.clears)
return pps return pps