@@ -45,12 +45,12 @@ def __lt__(self, other):
4545class MarketDataEvent (Event ):
4646 """Market data event."""
4747
48- symbol : str
49- open_price : float
50- high_price : float
51- low_price : float
52- close_price : float
53- volume : int
48+ symbol : str = ""
49+ open_price : float = 0.0
50+ high_price : float = 0.0
51+ low_price : float = 0.0
52+ close_price : float = 0.0
53+ volume : int = 0
5454 bid_price : Optional [float ] = None
5555 ask_price : Optional [float ] = None
5656
@@ -74,9 +74,9 @@ def __post_init__(self):
7474class SignalEvent (Event ):
7575 """Trading signal event."""
7676
77- symbol : str
78- signal_type : str # 'BUY', 'SELL', 'HOLD'
79- strength : float # Signal strength (0-1)
77+ symbol : str = ""
78+ signal_type : str = "" # 'BUY', 'SELL', 'HOLD'
79+ strength : float = 0.0 # Signal strength (0-1)
8080 metadata : Dict [str , Any ] = field (default_factory = dict )
8181
8282 def __post_init__ (self ):
@@ -136,7 +136,7 @@ class Order:
136136class OrderEvent (Event ):
137137 """Order event."""
138138
139- order : Order
139+ order : Order = None
140140
141141 def __post_init__ (self ):
142142 self .event_type = EventType .ORDER
@@ -171,7 +171,7 @@ class Fill:
171171class FillEvent (Event ):
172172 """Fill event."""
173173
174- fill : Fill
174+ fill : Fill = None
175175
176176 def __post_init__ (self ):
177177 self .event_type = EventType .FILL
@@ -198,7 +198,6 @@ def __init__(
198198 latency_model : str = "fixed" ,
199199 base_latency : float = 0.001 ,
200200 ): # 1ms
201-
202201 self .spread_model = spread_model
203202 self .base_spread = base_spread
204203 self .impact_model = impact_model
@@ -694,7 +693,6 @@ def __init__(
694693 portfolio : Portfolio ,
695694 market_simulator : MarketSimulator = None ,
696695 ):
697-
698696 self .data_handler = data_handler
699697 self .strategy = strategy
700698 self .portfolio = portfolio
0 commit comments