Skip to content

Commit

Permalink
Allow clients to specify order_management_system when cancelling orders
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjafer committed Jun 27, 2024
1 parent a51c2b4 commit 3a8d806
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion schwab_api/schwab.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,7 @@ def cancel_order_v2(
# The fields below are experimental and should only be changed if you know what
# you're doing.
instrument_type=46,
order_management_system=2, # You may need to change this based on the value returned from calling orders_v2
):
"""
Cancels an open order (specified by order ID) using the v2 API
Expand All @@ -598,7 +599,7 @@ def cancel_order_v2(
"""
data = {
"TypeOfOrder": 0,
"OrderManagementSystem": 2,
"OrderManagementSystem": order_management_system,
"Orders": [{
"OrderId": order_id,
"IsLiveOrder": True,
Expand Down

0 comments on commit 3a8d806

Please sign in to comment.