diff --git a/README.md b/README.md index 4e06477..8390139 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,8 @@ ft_order = order.Order(ft_ss) ft_order.place_order( ft_accounts.account_numbers[0], symbol='INTC', - order_type=order.PriceType.MARKET, + price_type=order.PriceType.MARKET, + order_type=order.OrderType.BUY, quantity=1, duration=order.Duration.DAY, dry_run=True diff --git a/firstrade/__pycache__/__init__.cpython-311.pyc b/firstrade/__pycache__/__init__.cpython-311.pyc deleted file mode 100644 index ac6b8df..0000000 Binary files a/firstrade/__pycache__/__init__.cpython-311.pyc and /dev/null differ diff --git a/firstrade/__pycache__/account.cpython-311.pyc b/firstrade/__pycache__/account.cpython-311.pyc deleted file mode 100644 index a6d2786..0000000 Binary files a/firstrade/__pycache__/account.cpython-311.pyc and /dev/null differ diff --git a/firstrade/__pycache__/order.cpython-311.pyc b/firstrade/__pycache__/order.cpython-311.pyc deleted file mode 100644 index f8956ff..0000000 Binary files a/firstrade/__pycache__/order.cpython-311.pyc and /dev/null differ diff --git a/firstrade/__pycache__/symbols.cpython-311.pyc b/firstrade/__pycache__/symbols.cpython-311.pyc deleted file mode 100644 index 2a8ab74..0000000 Binary files a/firstrade/__pycache__/symbols.cpython-311.pyc and /dev/null differ diff --git a/firstrade/__pycache__/urls.cpython-311.pyc b/firstrade/__pycache__/urls.cpython-311.pyc deleted file mode 100644 index 9c871d6..0000000 Binary files a/firstrade/__pycache__/urls.cpython-311.pyc and /dev/null differ diff --git a/firstrade/account.py b/firstrade/account.py index 6a38219..ec814fa 100644 --- a/firstrade/account.py +++ b/firstrade/account.py @@ -2,6 +2,7 @@ import pickle import re import os +from time import sleep from bs4 import BeautifulSoup from firstrade import urls @@ -162,6 +163,7 @@ def __init__(self, session): ).text, 'xml') balance = account_soup.find('total_account_value').text self.account_balances.append(balance) + sleep(2) data = { 'req': 'get_status'} account_status = self.session.post( url=urls.status(), diff --git a/firstrade/symbols.py b/firstrade/symbols.py index 07d9576..5ad2dfc 100644 --- a/firstrade/symbols.py +++ b/firstrade/symbols.py @@ -47,6 +47,8 @@ def __init__(self, ft_session: FTSession, symbol: str): else: self.high = float(quote.find('high').text) if quote.find('low').text == 'N/A': - self.low = None + self.low = 'None' + else: + self.low = float(quote.find('low').text) self.volume = quote.find('vol').text self.company_name = quote.find('companyname').text diff --git a/setup.py b/setup.py index c4b105e..223d6f1 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="firstrade", - version="0.0.8", + version="0.0.9", author="MaxxRK", author_email="maxxrk@pm.me", description="An unofficial API for Firstrade", @@ -13,7 +13,7 @@ long_description_content_type="text/markdown", license="MIT", url='https://github.com/MaxxRK/firstrade-api', - download_url='https://github.com/MaxxRK/firstrade-api/archive/refs/tags/008.tar.gz', + download_url='https://github.com/MaxxRK/firstrade-api/archive/refs/tags/009.tar.gz', keywords=['FIRSTRADE', 'API'], install_requires=['requests', 'beautifulsoup4', 'lxml'], packages=['firstrade'], diff --git a/test.py b/test.py index 82b3ea0..8600c41 100644 --- a/test.py +++ b/test.py @@ -44,7 +44,8 @@ ft_order.place_order( ft_accounts.account_numbers[0], symbol='INTC', - order_type=order.PriceType.MARKET, + price_type=order.PriceType.MARKET, + order_type=order.OrderType.BUY, quantity=1, duration=order.Duration.DAY, dry_run=True