-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dash UI #27
base: main
Are you sure you want to change the base?
Dash UI #27
Conversation
k8culver
commented
Oct 2, 2024
•
edited
Loading
edited
- Created a user interface option for running the demo
- Maintained the CLI run option
- Exposed settings for period type, solver type, stocks, dates, budget, and transaction cost
5fbf650
to
4be33b8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, and works great apart from a few issues:
- It's not very clear that the minimum time period is 4 months (which seems to be the case). Not sure where that restrictions comes from.
- When no feasible solution is found, an exception is raised (
raise Exception("No feasible solution could be found for this problem instance.")
) but the run isn't stopped. The user has to click the cancel button. - Multi-period seems to get stuck for some parameter choices. Might be for the same reason as above, but not sure.
- Could perhaps be nice to have a total revenue/loss (compared to fund portfolio) in the multi-period result.
src/single_period.py
Outdated
|
||
def __init__( | ||
self, | ||
stocks=("AAPL", "MSFT", "AAL", "WMT"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove these defaults and just have it be a mandatory arg? Would need to update a couple of tests only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess that'd work as long as I keep the default in portfolio.py for command line runs
src/single_period.py
Outdated
def run(self, min_return: float = 0, max_risk: float = 0, num: int = 0, init_holdings=None): | ||
"""Execute sequence of load_data --> build_model --> solve. | ||
|
||
Args: | ||
max_risk (int): Maximum risk for the risk bounding formulation. | ||
min_return (int): Minimum return for the return bounding formulation. | ||
num (int): Number of stocks to be randomnly generated. | ||
init_holdings (float): Initial holdings, or initial portfolio state. | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing return type and docstring.
src/multi_period.py
Outdated
|
||
def __init__( | ||
self, | ||
stocks=("AAPL", "MSFT", "AAL", "WMT"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove stocks defaults?
Co-authored-by: Theodor Isacsson <[email protected]>
89748eb
to
b3b05d5
Compare
What settings can I use to recreate these issues? |
I have no idea, it was like that before I inherited it, I will do my best to try to figure out why |
It happens e.g., when only having a single stock. Not sure if there are other cases, but if that might be so it's a good idea to catch this exception, cancel the run and show a note/notification that no feasible solution was found. |
a8fb4b6
to
e015532
Compare
e015532
to
4a3e767
Compare
I haven't run into this since fixing a few bugs so I haven't implemented this, but let me know if you run into it again and what settings you used. |