File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
src/project_x_py/realtime_data_manager Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ async def demonstrate_order_tracker() -> None:
100100 try :
101101 # Wait for any terminal status
102102 print ("Waiting for order completion..." )
103- completed = await tracker .wait_for_status (2 , timeout = 5 ) # FILLED
103+ _completed = await tracker .wait_for_status (2 , timeout = 5 ) # FILLED
104104 print ("✅ Order reached FILLED status" )
105105
106106 except TimeoutError :
Original file line number Diff line number Diff line change @@ -140,11 +140,11 @@ async def main() -> None:
140140 stop_loss=current_price - 50,
141141 take_profit=current_price + 100,
142142 )
143-
143+
144144 # Optional: Scale in if conditions are met
145145 if favorable_conditions:
146146 await trade.scale_in(additional_size=1)
147-
147+
148148 # Optional: Adjust stop to breakeven
149149 if price_moved_favorably:
150150 await trade.adjust_stop(new_stop_loss=entry_price)
Original file line number Diff line number Diff line change @@ -98,21 +98,21 @@ async def advanced_trade_management(suite: TradingSuite) -> None:
9898 stop_loss=entry_price - 30, # $30 stop
9999 order_type=OrderType.LIMIT,
100100 )
101-
101+
102102 # Wait for fill
103103 await suite.wait_for(EventType.ORDER_FILLED, timeout=300)
104-
104+
105105 # Scale in if price dips
106106 if current_price < entry_price - 5:
107107 await trade.scale_in(
108108 additional_size=1,
109109 new_stop_loss=entry_price - 25, # Tighten stop
110110 )
111-
111+
112112 # Move stop to breakeven after profit
113113 if current_price > entry_price + 20:
114114 await trade.adjust_stop(new_stop_loss=entry_price)
115-
115+
116116 # Scale out partial position
117117 if current_price > entry_price + 40:
118118 await trade.scale_out(
Original file line number Diff line number Diff line change 9898import polars as pl
9999
100100if TYPE_CHECKING :
101- from project_x_py . types import RealtimeDataManagerProtocol
101+ pass
102102
103103logger = logging .getLogger (__name__ )
104104
You can’t perform that action at this time.
0 commit comments