Skip to content

Commit

Permalink
Merge branch 'develop-formatting' into develop-webull
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Dec 29, 2023
2 parents ee43d50 + 32e6a77 commit 3da8502
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ RUN playwright install && \
# Grab needed files
COPY ./autoRSA.py .
COPY ./entrypoint.sh .
COPY ./entrypoint.sh .
COPY ./fidelityAPI.py .
COPY ./helperAPI.py .
COPY ./helperAPI.py .
COPY ./robinhoodAPI.py .
COPY ./schwabAPI.py .
COPY ./tastyAPI.py .
Expand Down
13 changes: 11 additions & 2 deletions fidelityAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,8 @@ def fidelity_transaction(fidelity_o: Brokerage, orderObj: stockOrder, loop=None)
value="#market-no > s-root > div > label > s-slot > s-assigned-wrapper",
)
limit_button.click()
# Set price
difference_price = 0.01 if float(ask_price) > 0.1 else 0.005
# Set price
difference_price = 0.01 if float(ask_price) > 0.1 else 0.001
if orderObj.get_action() == "buy":
wanted_price = round(float(ask_price) + difference_price, 3)
else:
Expand All @@ -453,6 +453,15 @@ def fidelity_transaction(fidelity_o: Brokerage, orderObj: stockOrder, loop=None)
)
price_box.clear()
price_box.send_keys(wanted_price)
# Check for margin account
try:
margin_cash = driver.find_element(
by=By.ID, value="tradetype-cash"
)
margin_cash.click()
print("Margin account found!")
except NoSuchElementException:
pass
# Preview order
WebDriverWait(driver, 10).until(check_if_page_loaded)
sleep(1)
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pyotp==2.9.0
python-dotenv==1.0.0
requests==2.31.0
robin_stocks==3.0.6
schwab-api==0.3.3
schwab-api==0.3.5
selenium==4.12.0
tastytrade==6.1
webull==0.6.1
Expand Down
1 change: 1 addition & 0 deletions schwabAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def schwab_init(SCHWAB_EXTERNAL=None):
name, account, account_info[account]["account_value"]
)
except Exception as e:
print(traceback.format_exc())
print(f"Error logging in to Schwab: {e}")
print(traceback.format_exc())
return None
Expand Down

0 comments on commit 3da8502

Please sign in to comment.