Skip to content

Commit

Permalink
disable tradier fractionals
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Oct 23, 2023
1 parent ffeb443 commit 28bfd52
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tradierAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,13 @@ def tradier_transaction(tradier_o: Brokerage, orderObj: stockOrder, loop=None):
)
for account in tradier_o.get_account_numbers(key):
obj: str = tradier_o.get_logged_in_objects(key)
# Tradier doesn't support fractional shares
if not orderObj.get_amount().is_integer():
printAndDiscord(
f"Tradier account {account} Error: Fractional share {orderObj.get_amount()} not supported",
loop=loop,
)
continue
if not orderObj.get_dry():
data = {
"class": "equity",
Expand Down

0 comments on commit 28bfd52

Please sign in to comment.