fidelipy
fidelipy is a simple Python 3.7+ library for semi-automated trading on fidelity.com. The scope is limited to the Trade Stocks/ETFs
simplified ticket and Trade Mutual Funds
pages.
from fidelipy import Action, Driver, Unit
from selenium.webdriver import Chrome
with Driver(Chrome()) as driver:
input("Log in, then press enter.")
try:
print(driver.cash_available_to_trade("123456789"))
print(driver.quote("BCDE"))
driver.market_order("123456789", "BCDE", Action.BUY, Unit.SHARES, "1")
except Exception:
print("Report or fix the issue on GitHub.")
input("Press enter to log out.")
Warning
fidelipy asks for manual confirmation:
Place order [Y/n]
Pressing enter uses the default value Y meaning yes.
Use
-
Install fidelipy:
pip install fidelipy
-
Read the documentation.
Build
Documentation
Install Sphinx:
pip install sphinx
Then run this command in the docs/
directory:
make html
Distribution package
Install build:
pip install build
Then run this command in the project root directory:
python -m build