Skip to content

Commit

Permalink
fix bad tasty orders on some accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Feb 21, 2024
1 parent 89c7ae7 commit d4900a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tastyAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ async def tastytrade_execute(tt_o: Brokerage, orderObj: stockOrder, loop=None):
)
order_status = placed_order.order.status.value
except Exception as e:
print(f"Error placing order: {e}")
if "preflight_check_failure" in str(e):
raise TastytradeError(e)
order_status = "Rejected"
printAndDiscord(
f"{key} {print_account}: Error placing order: {e}", loop=loop
)
continue
# Check order status
if order_status in ["Received", "Routed"]:
message = f"{key} {print_account}: {orderObj.get_action()} {orderObj.get_amount()} of {s} Order: {placed_order.order.id} Status: {order_status}"
Expand Down

0 comments on commit d4900a4

Please sign in to comment.