Support temp `Symbol` and non-copied model refs on `Order` msg
parent
92d6b19777
commit
374967dc6f
|
@ -24,6 +24,8 @@ from typing import Optional, Union
|
||||||
# import msgspec
|
# import msgspec
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
|
|
||||||
|
from ..data._source import Symbol
|
||||||
|
|
||||||
# Client -> emsd
|
# Client -> emsd
|
||||||
|
|
||||||
|
|
||||||
|
@ -42,7 +44,7 @@ class Order(BaseModel):
|
||||||
action: str # {'buy', 'sell', 'alert'}
|
action: str # {'buy', 'sell', 'alert'}
|
||||||
# internal ``emdsd`` unique "order id"
|
# internal ``emdsd`` unique "order id"
|
||||||
oid: str # uuid4
|
oid: str # uuid4
|
||||||
symbol: str
|
symbol: Union[str, Symbol]
|
||||||
|
|
||||||
price: float
|
price: float
|
||||||
size: float
|
size: float
|
||||||
|
@ -56,6 +58,13 @@ class Order(BaseModel):
|
||||||
# the backend broker
|
# the backend broker
|
||||||
exec_mode: str # {'dark', 'live', 'paper'}
|
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
|
# Client <- emsd
|
||||||
# update msgs from ems which relay state change info
|
# update msgs from ems which relay state change info
|
||||||
|
|
Loading…
Reference in New Issue