Support temp `Symbol` and non-copied model refs on `Order` msg

fsp_feeds
Tyler Goodlet 2021-08-15 12:30:22 -04:00
parent 92d6b19777
commit 374967dc6f
1 changed files with 10 additions and 1 deletions

View File

@ -24,6 +24,8 @@ from typing import Optional, Union
# import msgspec
from pydantic import BaseModel
from ..data._source import Symbol
# Client -> emsd
@ -42,7 +44,7 @@ class Order(BaseModel):
action: str # {'buy', 'sell', 'alert'}
# internal ``emdsd`` unique "order id"
oid: str # uuid4
symbol: str
symbol: Union[str, Symbol]
price: float
size: float
@ -56,6 +58,13 @@ class Order(BaseModel):
# the backend broker
exec_mode: str # {'dark', 'live', 'paper'}
class Config:
# just for pre-loading a ``Symbol`` when used
# in the order mode staging process
arbitrary_types_allowed = True
# don't copy this model instance when used in
# a recursive model
copy_on_model_validation = False
# Client <- emsd
# update msgs from ems which relay state change info