Compare commits
40 Commits
3dcee16bf6
...
c8bb8d7893
Author | SHA1 | Date |
---|---|---|
|
c8bb8d7893 | |
|
b4141d4208 | |
|
468b33cf60 | |
|
2c2fa990ed | |
|
7bc98f5055 | |
|
8b4bcf134c | |
|
3388bc89cc | |
|
b84880cce5 | |
|
7f5e655720 | |
|
b8ad77e861 | |
|
dbafb64bc3 | |
|
00fb5ceddd | |
|
e8d26f8b30 | |
|
fb76d1c9ed | |
|
9688f4899a | |
|
7298374fe4 | |
|
a7d8b5e1f4 | |
|
65e4bd80b2 | |
|
660c580786 | |
|
a2651fd1de | |
|
12d557f12b | |
|
8365b6d373 | |
|
badb7342f7 | |
|
b1bac1dc9f | |
|
be660f0275 | |
|
41e69af090 | |
|
01e8fe18dd | |
|
b104e603db | |
|
67424562ba | |
|
0a92f54b59 | |
|
bf1e2da1a7 | |
|
d11e1d1ee4 | |
|
cf2b507453 | |
|
61bde5a58d | |
|
43ec2e1897 | |
|
d7669ba18b | |
|
3821be082b | |
|
25d60d6bdd | |
|
a9178b211d | |
|
ec2203168a |
|
@ -30,8 +30,7 @@ from types import ModuleType
|
|||
from typing import (
|
||||
Any,
|
||||
Iterator,
|
||||
Generator,
|
||||
TYPE_CHECKING,
|
||||
Generator
|
||||
)
|
||||
|
||||
import pendulum
|
||||
|
@ -60,10 +59,8 @@ from ..clearing._messages import (
|
|||
BrokerdPosition,
|
||||
)
|
||||
from piker.types import Struct
|
||||
from piker.log import get_logger
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from piker.data._symcache import SymbologyCache
|
||||
from piker.data._symcache import SymbologyCache
|
||||
from ..log import get_logger
|
||||
|
||||
log = get_logger(__name__)
|
||||
|
||||
|
@ -496,17 +493,6 @@ class Account(Struct):
|
|||
|
||||
_mktmap_table: dict[str, MktPair] | None = None,
|
||||
|
||||
only_require: list[str]|True = True,
|
||||
# ^list of fqmes that are "required" to be processed from
|
||||
# this ledger pass; we often don't care about others and
|
||||
# definitely shouldn't always error in such cases.
|
||||
# (eg. broker backend loaded that doesn't yet supsport the
|
||||
# symcache but also, inside the paper engine we don't ad-hoc
|
||||
# request `get_mkt_info()` for every symbol in the ledger,
|
||||
# only the one for which we're simulating against).
|
||||
# TODO, not sure if there's a better soln for this, ideally
|
||||
# all backends get symcache support afap i guess..
|
||||
|
||||
) -> dict[str, Position]:
|
||||
'''
|
||||
Update the internal `.pps[str, Position]` table from input
|
||||
|
@ -549,32 +535,11 @@ class Account(Struct):
|
|||
if _mktmap_table is None:
|
||||
raise
|
||||
|
||||
required: bool = (
|
||||
only_require is True
|
||||
or (
|
||||
only_require is not True
|
||||
and
|
||||
fqme in only_require
|
||||
)
|
||||
)
|
||||
# XXX: caller is allowed to provide a fallback
|
||||
# mktmap table for the case where a new position is
|
||||
# being added and the preloaded symcache didn't
|
||||
# have this entry prior (eg. with frickin IB..)
|
||||
if (
|
||||
not (mkt := _mktmap_table.get(fqme))
|
||||
and
|
||||
required
|
||||
):
|
||||
raise
|
||||
|
||||
elif not required:
|
||||
continue
|
||||
|
||||
else:
|
||||
# should be an entry retreived somewhere
|
||||
assert mkt
|
||||
|
||||
mkt = _mktmap_table[fqme]
|
||||
|
||||
if not (pos := pps.get(bs_mktid)):
|
||||
|
||||
|
@ -691,7 +656,7 @@ class Account(Struct):
|
|||
def write_config(self) -> None:
|
||||
'''
|
||||
Write the current account state to the user's account TOML file, normally
|
||||
something like `pps.toml`.
|
||||
something like ``pps.toml``.
|
||||
|
||||
'''
|
||||
# TODO: show diff output?
|
||||
|
|
|
@ -653,7 +653,6 @@ async def open_trade_dialog(
|
|||
# in) use manually constructed table from calling
|
||||
# the `.get_mkt_info()` provider EP above.
|
||||
_mktmap_table=mkt_by_fqme,
|
||||
only_require=list(mkt_by_fqme),
|
||||
)
|
||||
|
||||
pp_msgs: list[BrokerdPosition] = []
|
||||
|
|
Loading…
Reference in New Issue