Skip to content

Commit

Permalink
use mask function
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Oct 14, 2024
1 parent 28e76e0 commit ca62e95
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fidelityAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from helperAPI import (
Brokerage,
getOTPCodeDiscord,
maskString,
printAndDiscord,
printHoldings,
stockOrder,
Expand Down Expand Up @@ -824,22 +825,23 @@ def fidelity_transaction(
account_number,
orderObj.get_dry(),
)
print_account = maskString(account_number)
# Report error if occurred
if not success:
printAndDiscord(
f"{name} account xxxxx{account_number[-4:]}: {orderObj.get_action()} {orderObj.get_amount()} {error_message}",
f"{name} account {print_account}: Error: {error_message}",
loop,
)
# Print test run confirmation if test run
elif success and orderObj.get_dry():
printAndDiscord(
f"DRY: {name} account xxxxx{account_number[-4:]}: {orderObj.get_action()} {orderObj.get_amount()} shares of {stock}",
f"DRY: {name} account {print_account}: {orderObj.get_action()} {orderObj.get_amount()} shares of {stock}",
loop,
)
# Print real run confirmation if real run
elif success and not orderObj.get_dry():
printAndDiscord(
f"{name} account xxxxx{account_number[-4:]}: {orderObj.get_action()} {orderObj.get_amount()} shares of {stock}",
f"{name} account {print_account}: {orderObj.get_action()} {orderObj.get_amount()} shares of {stock}",
loop,
)

Expand Down

0 comments on commit ca62e95

Please sign in to comment.