Skip to content

Commit

Permalink
fix message formats
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxxRK committed Nov 27, 2024
1 parent 8361ae0 commit ac23e92
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions firstradeAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ def firstrade_transaction(firstrade_o: Brokerage, orderObj: stockOrder, loop=Non
# Buy on each account
for s in orderObj.get_stocks():
for key in firstrade_o.get_account_numbers():
printAndDiscord(
f"{key} {orderObj.get_action()}ing {orderObj.get_amount()} {s} @ {orderObj.get_price()}",
loop,
)
for account in firstrade_o.get_account_numbers(key):
obj: ft_account.FTSession = firstrade_o.get_logged_in_objects(key)
print_account = maskString(account)
Expand Down Expand Up @@ -167,7 +163,8 @@ def firstrade_transaction(firstrade_o: Brokerage, orderObj: stockOrder, loop=Non
# Do the dance
quantity = 100
printAndDiscord(
f"Buying {quantity} then selling {quantity - orderObj.get_amount()} of {s}"
f"Buying {quantity} then selling {quantity - orderObj.get_amount()} of {s}",
loop,
)
orderObj.set_amount(quantity)
ft_order = order.Order(obj)
Expand All @@ -189,7 +186,7 @@ def firstrade_transaction(firstrade_o: Brokerage, orderObj: stockOrder, loop=Non
f"{key} account {print_account}: The buy order verification was "
+ "successful"
if buy_success
else "unsuccessful"
else f"{key} account {print_account}: The sell order verification was unsuccessful"
),
loop,
)
Expand Down Expand Up @@ -223,7 +220,7 @@ def firstrade_transaction(firstrade_o: Brokerage, orderObj: stockOrder, loop=Non
f"{key} account {print_account}: The sell order verification was "
+ "successful"
if sell_success
else "unsuccessful"
else f"{key} account {print_account}: The sell order verification was unsuccessful"
),
loop,
)
Expand Down Expand Up @@ -254,7 +251,7 @@ def firstrade_transaction(firstrade_o: Brokerage, orderObj: stockOrder, loop=Non
f"{key} account {print_account}: The order verification was "
+ "successful"
if order_success
else "unsuccessful"
else f"{key} account {print_account}: The sell order verification was unsuccessful"
),
loop,
)
Expand Down

0 comments on commit ac23e92

Please sign in to comment.