Adjust `.clearing._paper_engine.norm_trade()` to new sig
Always expect a `tid: str` and `pair: dict[str, Struct]` for aiding with txn struct packing B)account_tests
parent
3d20490ee5
commit
d794afcb5c
|
@ -281,7 +281,8 @@ class PaperBoi(Struct):
|
||||||
)
|
)
|
||||||
|
|
||||||
# transmit pp msg to ems
|
# transmit pp msg to ems
|
||||||
pp = self.acnt.pps[bs_mktid]
|
pp: Position = self.acnt.pps[bs_mktid]
|
||||||
|
|
||||||
pp_msg = BrokerdPosition(
|
pp_msg = BrokerdPosition(
|
||||||
broker=self.broker,
|
broker=self.broker,
|
||||||
account='paper',
|
account='paper',
|
||||||
|
@ -327,6 +328,7 @@ async def simulate_fills(
|
||||||
# this stream may eventually contain multiple symbols
|
# this stream may eventually contain multiple symbols
|
||||||
async for quotes in quote_stream:
|
async for quotes in quote_stream:
|
||||||
for sym, quote in quotes.items():
|
for sym, quote in quotes.items():
|
||||||
|
# print(sym)
|
||||||
for tick in iterticks(
|
for tick in iterticks(
|
||||||
quote,
|
quote,
|
||||||
# dark order price filter(s)
|
# dark order price filter(s)
|
||||||
|
@ -617,6 +619,7 @@ async def open_trade_dialog(
|
||||||
pos: Position
|
pos: Position
|
||||||
token: str # f'{symbol}.{self.broker}'
|
token: str # f'{symbol}.{self.broker}'
|
||||||
for token, pos in acnt.pps.items():
|
for token, pos in acnt.pps.items():
|
||||||
|
|
||||||
pp_msgs.append(BrokerdPosition(
|
pp_msgs.append(BrokerdPosition(
|
||||||
broker=broker,
|
broker=broker,
|
||||||
account='paper',
|
account='paper',
|
||||||
|
@ -735,7 +738,9 @@ async def open_paperboi(
|
||||||
|
|
||||||
|
|
||||||
def norm_trade(
|
def norm_trade(
|
||||||
|
tid: str,
|
||||||
txdict: dict,
|
txdict: dict,
|
||||||
|
pairs: dict[str, Struct],
|
||||||
|
|
||||||
) -> Transaction:
|
) -> Transaction:
|
||||||
from pendulum import (
|
from pendulum import (
|
||||||
|
|
Loading…
Reference in New Issue