Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
c12d6fd
more detailed quotes
Jun 2, 2024
652d8b0
fix test.py
Jun 2, 2024
e5c7cf1
style: format code with Black and isort
deepsource-autofix[bot] Jun 2, 2024
f588748
updateSetup
Jun 2, 2024
5c62d88
Merge pull request #28 from MaxxRK/deepsource-transform-72a4f28b
MaxxRK Jun 2, 2024
bbdf540
fix quote 0 int values
Jun 21, 2024
206c787
fix order warnings
Jul 13, 2024
41f6898
style: format code with Black and isort
deepsource-autofix[bot] Jul 13, 2024
2bb2ba9
Merge pull request #33 from MaxxRK/deepsource-transform-ec61c7e3
MaxxRK Jul 13, 2024
e5920fc
add order instructions
MaxxRK Jul 25, 2024
f2da7e0
style: format code with Black and isort
deepsource-autofix[bot] Jul 25, 2024
6e82403
Merge pull request #35 from MaxxRK/deepsource-transform-a836dba2
MaxxRK Jul 25, 2024
dc8c1ef
add AON checks
MaxxRK Jul 25, 2024
d5b9f53
fix AON checks
MaxxRK Jul 25, 2024
0ac9666
style: format code with Black and isort
deepsource-autofix[bot] Jul 25, 2024
c08bf99
Merge pull request #37 from MaxxRK/deepsource-transform-9bdff723
MaxxRK Jul 25, 2024
0c45a41
start adding options
MaxxRK Jul 26, 2024
ac5d95a
adding options
MaxxRK Jul 26, 2024
2f037a5
authentication/symbols switched
MaxxRK Aug 7, 2024
f0ed671
remove unused libraries
MaxxRK Aug 7, 2024
fac73b3
working on orders
MaxxRK Aug 8, 2024
930154c
more order work
MaxxRK Aug 8, 2024
36a2b68
add disclaimer
MaxxRK Aug 9, 2024
b8eac7a
some cleanup add option quotes
MaxxRK Aug 10, 2024
2763c8b
add totp docstrings
MaxxRK Aug 15, 2024
2b3add8
update account
MaxxRK Aug 16, 2024
cb4890c
remove unneded exceptions
MaxxRK Aug 17, 2024
a553147
cleanup
MaxxRK Aug 17, 2024
769d097
fix stylings
MaxxRK Aug 18, 2024
9bbf99a
more style fixes
MaxxRK Aug 18, 2024
65d704e
style: format code with Black and isort
deepsource-autofix[bot] Aug 18, 2024
d9d8376
fix readme
MaxxRK Aug 18, 2024
77010d3
Merge pull request #42 from MaxxRK/deepsource-transform-9ad9744f
MaxxRK Aug 18, 2024
92648d5
update readme
MaxxRK Aug 18, 2024
704a092
add error if account not ok
MaxxRK Aug 29, 2024
02dfc29
bump version
MaxxRK Aug 29, 2024
da39e39
Add account history query functionality with custom date range and in…
lichhuan Jan 31, 2025
6996e51
format fixes bump versions
Jan 31, 2025
5864ac0
remove whitespaces
Jan 31, 2025
bfcfd0d
Merge pull request #49 from libao3128/develop
MaxxRK Jan 31, 2025
d9635ad
style: format code with Black and isort
deepsource-autofix[bot] Jan 31, 2025
410e178
refactor: remove unnecessary whitespace
deepsource-autofix[bot] Jan 31, 2025
f23aeb5
style: format code with Black and isort
deepsource-autofix[bot] Jan 31, 2025
0de6122
Merge pull request #50 from MaxxRK/deepsource-transform-6d14fc2b
MaxxRK Jan 31, 2025
2c17481
Merge pull request #51 from MaxxRK/deepsource-autofix-5a2fe403
MaxxRK Jan 31, 2025
c246af6
refactor: add newline at end of file
deepsource-autofix[bot] Jan 31, 2025
3d32db6
Merge pull request #52 from MaxxRK/deepsource-autofix-51703504
MaxxRK Jan 31, 2025
c53d392
refactor: remove unnecessary `pass`
deepsource-autofix[bot] Jan 31, 2025
ee025c3
Merge pull request #53 from MaxxRK/deepsource-autofix-0419bcc3
MaxxRK Jan 31, 2025
1587af0
fix bid ask last
Mar 26, 2025
4505dc1
remove print
Mar 26, 2025
f3f7247
feat: add get_balance_overview method and fix string formatting in pr…
coolthor Sep 22, 2025
d091c9d
fix: add break statements to improve MFA recipient selection logic
coolthor Oct 13, 2025
345e928
Merge pull request #65 from coolthor/main
MaxxRK Oct 13, 2025
3c7623e
style: format code with Black and isort
deepsource-autofix[bot] Oct 13, 2025
8584f71
bump version
MaxxRK Oct 13, 2025
4577a16
Merge pull request #66 from MaxxRK/deepsource-transform-b8220318
MaxxRK Oct 13, 2025
fb8e60e
update requires
MaxxRK Jan 27, 2026
172bb1a
Handle missing MFA method in login process
Amodio Feb 3, 2026
259e531
Fix indentation for raising LoginResponseError
Amodio Feb 3, 2026
a7e306d
Use a more appropriate exception for MFA login failure
Amodio Feb 3, 2026
de0e0cd
Change account number for fetching positions
Amodio Feb 3, 2026
09555e7
Merge pull request #75 from Amodio/Amodio-fix-test-acc-numbers
MaxxRK Feb 3, 2026
e40a16d
Merge pull request #73 from Amodio/Amodio-mfa-error
MaxxRK Feb 3, 2026
16bd1ac
bump version
MaxxRK Feb 3, 2026
2b53d08
add styles pyproject
MaxxRK Feb 3, 2026
c77a558
nuke deepsource refactor
MaxxRK Feb 3, 2026
4936b35
Add HTTP logging with the debug attribute passed to FTSession.
Amodio Feb 3, 2026
6965073
Fix a bug while loading/restoring the session cookie from last commit.
Amodio Feb 3, 2026
91f53bc
Merge pull request #76 from Amodio/add-logging
MaxxRK Feb 4, 2026
6b67aad
Merge pull request #77 from Amodio/fix-load_cookies
MaxxRK Feb 4, 2026
d9cff69
bump version
MaxxRK Feb 4, 2026
e2a3dde
bump version
MaxxRK Feb 4, 2026
5f4e1bc
allow mfa code input more robust login
MaxxRK Feb 4, 2026
819d7ca
Several improvements to test.py:
Amodio Feb 4, 2026
f3f9eba
Made the test.py script executable
Amodio Feb 4, 2026
a6b1309
Merge pull request #78 from Amodio/fix-test_py
MaxxRK Feb 5, 2026
30652b9
PRE_MARKET&AFTER_MARKET orders have been replaced by OVERNIGHT: `The …
Amodio Feb 5, 2026
08a7182
Add OHLC data retrieval to fix #64
Amodio Feb 5, 2026
59c6e20
Merge pull request #79 from Amodio/fix-overnight-orders
MaxxRK Feb 5, 2026
8321d78
Merge pull request #80 from Amodio/add-ohlc-data
MaxxRK Feb 5, 2026
f0d892b
bump version
MaxxRK Feb 5, 2026
e3556b8
import and code formatting
MaxxRK Feb 5, 2026
09ff914
allow external login token save session flag
MaxxRK Feb 6, 2026
0ec0eb3
remove bad imports
MaxxRK Feb 6, 2026
4d4874f
revert external token add get tokens method
MaxxRK Feb 8, 2026
67c5af3
allow session build with tokens
MaxxRK Feb 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .deepsource.toml

This file was deleted.

137 changes: 2 additions & 135 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,135 +1,2 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
testme.py
*.pkl

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

user_data_dir
auth.json
*.png
# Created by venv; see https://docs.python.org/3/library/venv.html
*
37 changes: 25 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ In order to use Fractional shares you must accept the agreement on the website b

## Contribution

I am new to coding and new to open-source. I would love any help and suggestions!
Please feel free to contribute to this project. If you find any bugs, please open an issue.

## Disclaimer
I am not a financial advisor and not affiliated with Firstrade in any way. Use this tool at your own risk. I am not responsible for any losses or damages you may incur by using this project. This tool is provided as-is with no warranty.

## Setup

Expand All @@ -24,33 +27,43 @@ pip install firstrade

## Quikstart

`Checkout test.py for sample code.`

This code will:
The code in `test.py` will:
- Login and print account info.
- Get a quote for 'INTC' and print out the information
- Place a market order for 'INTC' on the first account in the `account_numbers` list
- Place a dry run market order for 'INTC' on the first account in the `account_numbers` list
- Print out the order confirmation

`Checkout test.py for sample code.`

- Contains a cancel order example
- Get OHLC data
- Get an option Dates, Quotes, and Greeks
- Place a dry run option order
---

## Implemented Features

- [x] Login
- [x] Login (With all 2FA methods now supported!)
- [x] Get Quotes
- [x] Get OHLC (timestamp, open, high, low, close, volume)
- [x] Get Account Data
- [x] Place Orders and Receive order confirmation
- [x] Get Currently Held Positions
- [x] Fractional Trading support (thanks to @jiak94)
- [x] Check on placed order status. (thanks to @Cfomodz)
- [x] Cancel placed orders
- [x] Options (Orders, Quotes, Greeks)
- [x] Order History

## TO DO

- [ ] Cancel placed orders
- [ ] Options
- [ ] Test options fully
- [ ] Give me some Ideas!

## Options

### I am very new to options trading and have not fully tested this feature.

Please:
- USE THIS FEATURE LIKE IT IS A ALPHA/BETA
- PUT IN A GITHUB ISSUE IF YOU FIND ANY PROBLEMS

## If you would like to support me, you can do so here:
[![GitHub Sponsors](https://img.shields.io/github/sponsors/maxxrk?style=social)](https://github.com/sponsors/maxxrk)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/maxxrk?style=social)](https://github.com/sponsors/maxxrk)
Loading