Oof, fix closed position popping by fqme..

master
Tyler Goodlet 2023-05-18 12:52:34 -04:00
parent 8d7a9fa19e
commit 89d24cfe33
1 changed files with 4 additions and 3 deletions

View File

@ -724,8 +724,9 @@ class PpTable(Struct):
# drop any entries that are computed as net-zero # drop any entries that are computed as net-zero
# we don't care about storing in the pps file. # we don't care about storing in the pps file.
if closed: if closed:
for fqme in closed: bs_mktid: str
self.conf.pop(fqme, None) for bs_mktid, pos in closed.items():
self.conf.pop(pos.symbol.fqme)
# if there are no active position entries according # if there are no active position entries according
# to the toml dump output above, then clear the config # to the toml dump output above, then clear the config
@ -879,7 +880,7 @@ def open_pps(
trans: list[Transaction] = [] trans: list[Transaction] = []
for clears_table in toml_clears_list: for clears_table in toml_clears_list:
tid = clears_table.pop('tid') tid = clears_table.get('tid')
dtstr = clears_table['dt'] dtstr = clears_table['dt']
dt = pendulum.parse(dtstr) dt = pendulum.parse(dtstr)
clears_table['dt'] = dt clears_table['dt'] = dt