Skip to content

Commit

Permalink
check for fidelity margin account
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Dec 22, 2023
1 parent 76996a2 commit 2d37faf
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions fidelityAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,17 @@ def fidelity_transaction(fidelity_o: Brokerage, orderObj: stockOrder, loop=None)
)
price_box.clear()
price_box.send_keys(wanted_price)
# Check for margin account
try:
print("Checking for margin account...")
margin_cash = driver.find_element(
by=By.ID, value="tradetype-cash"
)
margin_cash.click()
print("Margin account found!")
except NoSuchElementException:
print("Not a margin account")
pass
# Preview order
WebDriverWait(driver, 10).until(check_if_page_loaded)
sleep(1)
Expand Down

0 comments on commit 2d37faf

Please sign in to comment.