Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxxRK committed Nov 6, 2023
1 parent 9cbc0c1 commit 73ea1db
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file removed firstrade/__pycache__/__init__.cpython-311.pyc
Binary file not shown.
Binary file removed firstrade/__pycache__/account.cpython-311.pyc
Binary file not shown.
Binary file removed firstrade/__pycache__/order.cpython-311.pyc
Binary file not shown.
Binary file removed firstrade/__pycache__/symbols.cpython-311.pyc
Binary file not shown.
Binary file removed firstrade/__pycache__/urls.cpython-311.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions firstrade/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pickle
import re
import os
from time import sleep
from bs4 import BeautifulSoup
from firstrade import urls

Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 3 additions & 1 deletion firstrade/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

setuptools.setup(
name="firstrade",
version="0.0.8",
version="0.0.9",
author="MaxxRK",
author_email="[email protected]",
description="An unofficial API for Firstrade",
long_description=long_description,
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'],
Expand Down
3 changes: 2 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 73ea1db

Please sign in to comment.