|
60 | 60 | # ============================================================ |
61 | 61 |
|
62 | 62 | # normal equity order |
| 63 | + # normal equity order |
| 64 | + # leg_in_or_out: Currently, only the US market is supported. |
| 65 | + # Specifies whether this order is adding or removing a leg from an existing position. |
| 66 | + # LEG_IN: Add this leg to an existing position to form a multi-leg strategy. |
| 67 | + # LEG_OUT: Close this leg from an existing multi-leg strategy position. |
| 68 | + # position_id: Currently, only the US market is supported. |
| 69 | + # The unique position identifier of the target leg. Obtained from the Account Positions API. |
| 70 | + # Required when leg_in_or_out is specified. |
| 71 | + # leg_in_strategy: Currently, only the US market is supported. |
| 72 | + # The target strategy type expected after legging in. Only applicable when leg_in_or_out is LEG_IN. |
| 73 | + # (e.g., VERTICAL, CALENDAR, STRANGLE, STRADDLE, IRON_CONDOR, BUTTERFLY, CUSTOM). |
63 | 74 | normal_equity_client_order_id = uuid.uuid4().hex |
64 | 75 | print('client order id:', normal_equity_client_order_id) |
65 | 76 | new_normal_equity_orders = [ |
|
76 | 87 | "side": "BUY", |
77 | 88 | "time_in_force": "DAY", |
78 | 89 | "entrust_type": "QTY", |
| 90 | + "leg_in_or_out": "LEG_IN", |
| 91 | + "position_id": "<your_position_id>", |
| 92 | + "leg_in_strategy": "VERTICAL", |
79 | 93 | # Currently, only Webull JP is supported. |
80 | 94 | # "account_tax_type":"GENERAL", |
81 | 95 | # "margin_type": "ONE_DAY" |
|
119 | 133 | if res.status_code == 200: |
120 | 134 | print('get order detail res:', res.json()) |
121 | 135 |
|
| 136 | + res = trade_client.order_v3.get_order_executions(account_id, client_order_id= "", start_date="2026-01-20", end_date="2026-01-23") |
| 137 | + if res.status_code == 200: |
| 138 | + print('get order executions res:', res.json()) |
122 | 139 |
|
123 | 140 |
|
124 | 141 | # combo equity order |
|
257 | 274 |
|
258 | 275 | # normal option order |
259 | 276 | # position_intent: Currently, only the US market is supported, and only options orders are allowed. |
| 277 | + # leg_in_or_out: Currently, only the US market is supported. |
| 278 | + # Specifies whether this leg is being legged into or legged out of an existing position. |
| 279 | + # LEG_IN: Add this leg to an existing position. |
| 280 | + # LEG_OUT: Close this leg from an existing multi-leg strategy position. |
| 281 | + # position_id: Currently, only the US market is supported. |
| 282 | + # The unique position identifier of the target leg to be legged in or legged out. Obtained from the Account Positions API. Required when leg_in_or_out is specified. |
| 283 | + # leg_in_strategy: Currently, only the US market is supported. |
| 284 | + # The target strategy type expected after legging in. Specifies what multi-leg strategy the position should become once this leg is added. Only applicable when leg_in_or_out is LEG_IN. |
| 285 | + # (e.g., VERTICAL, CALENDAR, STRANGLE, STRADDLE, IRON_CONDOR, BUTTERFLY, CUSTOM). |
260 | 286 | normal_option_client_order_id = uuid.uuid4().hex |
261 | 287 | new_normal_option_orders = [ |
262 | 288 | { |
|
270 | 296 | "time_in_force": "GTC", |
271 | 297 | "entrust_type": "QTY", |
272 | 298 | "position_intent": "BUY_TO_OPEN", |
| 299 | + "leg_in_or_out": "LEG_IN", |
| 300 | + "position_id": "<your_position_id>", |
| 301 | + "leg_in_strategy": "VERTICAL", |
273 | 302 | "legs": [ |
274 | 303 | { |
275 | 304 | "side": "BUY", |
|
0 commit comments