Skip to content

Commit

Permalink
fix fennel short tickers?
Browse files Browse the repository at this point in the history
  • Loading branch information
NelsonDane committed Oct 7, 2024
1 parent 1539440 commit 6838111
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions fennelAPI.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,18 @@ def fennel_init(FENNEL_EXTERNAL=None, botObj=None, loop=None):
else:
raise e
fennel_obj.set_logged_in_object(name, fb, "fb")
full_accounts = fb.get_full_accounts()
for a in full_accounts:
b = fb.get_portfolio_summary(a["id"])
fennel_obj.set_account_number(name, a["name"])
account_ids = fb.get_account_ids()
for i, an in enumerate(account_ids):
account_name = f"Account {i + 1}"
b = fb.get_portfolio_summary(an)
fennel_obj.set_account_number(name, account_name)
fennel_obj.set_account_totals(
name,
a["name"],
account_name,
b["cash"]["balance"]["canTrade"],
)
fennel_obj.set_logged_in_object(name, a["id"], a["name"])
print(f"Found account {a['name']}")
fennel_obj.set_logged_in_object(name, an, account_name)
print(f"Found {account_name}")
print(f"{name}: Logged in")
except Exception as e:
print(f"Error logging into Fennel: {e}")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bbae-invest-api==0.1.3
chaseinvest-api==0.2.6
discord.py==2.4.0
dspac_invest_api==0.1.3
fennel-invest-api==1.1.0
fennel-invest-api==1.1.1
firstrade==0.0.30
GitPython==3.1.43
# playwright stealth from pypi seems abandoned
Expand Down

0 comments on commit 6838111

Please sign in to comment.