From 28bfd52c00f9544cac45dbc6e8facfa302f04c5b Mon Sep 17 00:00:00 2001 From: Nelson Dane <47427072+NelsonDane@users.noreply.github.com> Date: Sun, 22 Oct 2023 23:21:08 -0400 Subject: [PATCH] disable tradier fractionals --- tradierAPI.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tradierAPI.py b/tradierAPI.py index 2846b949..676fa064 100644 --- a/tradierAPI.py +++ b/tradierAPI.py @@ -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",