Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
468 views

Problem retrieving index variables in finance

The table is not able to access different variables to display in the table. Here is the index function def index(): """Show portfolio of stocks""" """Selecting shares that have been purchased ...
0
votes
2answers
262 views

Finance: UNIQUE constraint failed: users.username

I've been struggling with this for days. Ignore the '1234' hardcoded into the "insert into" line, just using that to isolate problems. The problem I'm facing is with the username being ...
0
votes
1answer
58 views

I can't even get register to work. What am I missing?

I'm getting a Error 500 (-Internal error due to server overload) when I attempt to flask run for pset8-Finance. Here is my app.route("/register") @app.route("/register", methods=["GET", "POST"]) ...
0
votes
1answer
83 views

Pset7 Finance Buy Runtime Error - Date

When I try to update the users portfolio I receive a runtime error from passing in 'when' as date('now'). Please can someone tell what I should be doing. Here is part of my buy function code. # ...
0
votes
1answer
37 views

I can't find where my variable names are mixed up

I'm stuck on pset7 and I have been for a while. I'm working on index and I'm pretty sure some of my variable names got mixed up, or I used the wrong names or something like that. I just can't figure ...
0
votes
1answer
18 views

For finance, does anyone know why my page to buy stocks does not work?

Here is my python code @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request....
0
votes
1answer
14 views

For finance, does anyone know why my page for selling stocks does not work?

Here is my python code. @app.route("/sell", methods=["GET", "POST"]) @login_required def sell(): """Sell shares of stock""" if ...
0
votes
0answers
5 views

Does anyone know why my history page does not provide a table but rather just the headers of the table when loaded? (CS50 finance)

Here is my python code. @app.route("/history") @login_required def history(): """Show history of transactions""" history = db.execute("SELECT time, ...
0
votes
0answers
9 views

For CS50 finance, does anyone know why does my query page not work?

The frontend loads ok, but when I search for a stock, I get an error of 404 not found. Here is my python code. @app.route("/quote", methods=["GET", "POST"]) @...
1
vote
1answer
98 views

CS50 Finance: Index - list indices must be integers or slices, not str

I've been stuck on this for quite some time. I believe that I'm getting back data in the form of a dictionary but can't figure out how to get the information that I need. Error messages that have ...
0
votes
1answer
234 views

Stuck at 57% in Pset 8 Finance

I cannot fix some problems in Pset8 because in my gradebook, Finance is still at 57%. Here are the errors that I have after I used check50: :( logging in as registered user succceeds application ...
1
vote
1answer
100 views

Pset7 Finance Unable to Buy Multiple Shares

I am able to make 1 purchase which appears on my index page, however if I try buy any further stocks my cash goes down but the stocks are not shown and aren't inserted into my portfolio. Here is my ...
1
vote
3answers
330 views

CS50 FINANCE- INDEX doesn't display price

I am trying to do the index part of this pset but the problem is since I want the price to be the current price, not price bought, I need to use the lookup function. But how do I display the price? ...
1
vote
2answers
35 views

finance password strength validation fails to call function

I'm trying to call a function which I've defined but the code fails to call it. Does it matter where the function is defined? def register(): """Register user""" ...
0
votes
1answer
107 views

CS50 Pset7 Finance HTML Table Not Aligned

The index table looks pretty good, but the "Price" and "Total" columns in the history table are not aligned with the headers. The code for the two is nearly identical. Here is the code for index....
0
votes
2answers
31 views

Finance - Index showing correct number of rows but all the same record. For- loop issue?

So I've been looking at this all morning and can't figure what I'm doing wrong. All my variables are producing the correct values so it seems to be something to do with my For loop. In the html ...
1
vote
1answer
64 views

Pset7 Yahoo finance broken

I've been working on this problem for a long time. I've asked people about my code and they say everything looks fine with it, and I've been told the yahoo finance has been taken down. I can't do this ...
0
votes
1answer
119 views

pset7 index function won't iterate through stocks

I'm having some serious trouble getting the index function to iterate through each of the user's stocks to obtain the current market price. It correctly outputs a list of the user's stocks along with ...
0
votes
2answers
43 views

Finance Check50

I completed Finance and everything seems to be working for me but when I use check50 it gives error. https://submit.cs50.io/check50/9d1a3517645a1207b1792d521c920386d586caf0 As you can see it shows ...
0
votes
1answer
212 views

IDE is not letting me hash the password. Should I change th hashing algorithm as it tells me to?

I implemented the register function for pset7. It went to the register page that I had implemented. I gave the required credentials and clicked Register. But instead of registering with the ...
0
votes
1answer
63 views

Pset 7 - check50 error on buy

Almost finished Pset7 but I'm getting an error on Check50 that I don't understand. The log file says: :( buy handles valid purchase Log sending POST request to /login sending POST request to /buy ...
0
votes
1answer
69 views

CASH NOT UPDATING - FINANCE SELL

so everything I have so far is working except the part where I need to update the cash right after I sell a stock. As you can see in the table below what's happening is that everytime I sell a stock ...
0
votes
0answers
22 views

Internal Server Error just using the distribution code in CS50 Finance

The distribution code for new CS50-Finance application is not working. It is giving Internal Server Error when I do "flask run". Can you please help? ~/workspace/ $ cd finance ~/workspace/...
1
vote
1answer
361 views

CS50 Finance not showing up

I'm starting CS50 Finance and I've reached a small hitch. When I try to load the page "pset7"/localhost (After doing all the first steps listed in the spec), I don't get the CS50 Finance logo, but ...
0
votes
1answer
161 views

Finance PROBLEM with lookup: TypeError: quote_from_bytes() expected bytes

I have Finance barely ready but like most codes, it has a buggy near the finish line. I have a problem with lookup. Always return None. I check it. and Terminal shows this error: TypeError: ...
0
votes
2answers
22 views

CS50 IDE gives error for flask run

I was able to run flask run till yesterday. But today it is not working, it has been giving errors for SQL and I have been able to code today. It gives me this error continuously. ERROR: Error on ...
0
votes
1answer
41 views

register not inserting credentials and returning invalid username/password

I almost spent a whole day on this. I saw every letter in the function, but still didn't got any progress. When I register, It show like this here's my code: @app.route("/register", methods=...
0
votes
2answers
114 views

when i hit the submit button on buy, I get a blank screen

Here is my buy form <html> <form action="buy.php" method="POST"> <fieldset> <div class="form-group"> <input autofocus name="symbol" placeholder="...
0
votes
1answer
95 views

Dropdown menu not showing. How do I fix it?

https://imgur.com/a/CrV15 You can see the above Imgur album to see what I'm talking about. Basically I can't see what options I have selected in my dropdown menu after selection. This is my sell....
0
votes
1answer
13 views

Why do my defaultdict get overwritten?

I'm trying to add two lists to a defaultdict, by the following code: for index, holding in enumerate(holdings): # Get all relevant numbers symbol = holding['symbol'] stock = lookup(symbol) ...
0
votes
1answer
592 views

pset7 finance register function check 50

after I run check50 I get following comments: Below are my code for register: @app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" session.clear() if request.method =...
0
votes
1answer
35 views

Pset8 Finance personal touch

I decided to go with trading from index without manually typing the symbol. Also, I decided to simply go to the buy/sell page with the symbol pre-selected by a GET method (without quantities being ...
0
votes
1answer
107 views

cs50 pset7 finance always get an error in valid buy execution;;;;;

@app.route("/") @login_required def index(): """Show portfolio of stocks""" cash = db.execute('SELECT cash FROM users where id=:id',id=session["user_id"]) cash = cash[0]["cash"] stocks ...
0
votes
1answer
224 views

Pset7 check50 buy error :( buy handles valid purchase

:( buy handles valid purchase expected to find "112.00" in page, but it wasn't found Log sending POST request to /login sending POST request to /buy checking that "112.00" is in ...
0
votes
1answer
25 views

:( buy handles valid purchase Pset7 Why is this such a problem

I've checked all of the posts on this subject however I can't find an answer. When running Check50 I'm getting then following error: ":( buy handles valid purchase expected to find "112.00" in page, ...
0
votes
1answer
283 views

Pset7 Finance Buy Function Internal Server Error

When I try to insert the portfolio values into the SQL database I receive an internal server error, please can someone tell me what I'm doing wrong. if request.method == "POST": # ensure symbol ...
1
vote
1answer
880 views

AlphaVantage API Error “Please consider optimizing your API call frequency”

On C$50 Finance, when I refresh my web server too many times, AlphaVantage stops returning stock quotes. As a result, Flask returns "TypeError: 'NoneType' object is not subscriptable" when my code ...
0
votes
1answer
1k views

Pset7 finance quote problem

I'm trying to get the stocks by quote and it worked just fine a week ago but it suddenly stopped working. Can someone please explain me what has changed and how I should alter my code to get it ...
1
vote
1answer
2k views

How to display python list in index.html ? finance - index.html

I need is to display the list below in index.html file. print (stock_info) [{'symbol': 'AAPL', 'name': 'Apple Inc.', 'price': 145.16, 'quantity': 20}, {'symbol': 'AMZN', 'name'...
0
votes
1answer
112 views

finance, how can I keep user log in

I'm confused with the walkthrough, how can I keep the user is logged in status? I tried to save it into session['user_id'] = results[0]['id'] But it doesn't work
0
votes
2answers
157 views

The predefined login function does not seem to be working in finance

All the registered ids are not able to log in. Even though the username and password are correct the website returns 400 error def login(): """Log user in""" # Forget any user_id session.clear() # ...
0
votes
1answer
149 views

pset7 finance register sql

I've been working on the register part of the finance problem and I think I have most of it but I really don't understand how to do the SQL parts of it. I need to learn how to store the username and ...
0
votes
1answer
573 views

C$50 Finance Registering Error

In check and register, my application is returning wrong results for if there is a duplicate username. If I type a duplicate username, it just adds it to the database. A registering and logging in ...
0
votes
1answer
186 views

Pset7 Sell: can't display dropdown menu items

Trying to implement a dropdown menu in sell_form.php so that the user can choose one of the stocks he/she owns and sell it. However, the dropdown menu doesn't seem to be working properly, can someone ...
0
votes
1answer
101 views

run time error when using joint primary key

I have a joint primary key between two columns (symbol and user_id) and I want to insert the columns the first time and after that update them with the old value + the new value, Here is my insert ...
0
votes
1answer
211 views

The view function did not return a valid response. The function either returned None or ended without a return statement

I can't figure out what is wrong in my code My python code: def buy(): """Buy shares of stock""" if request.method == "GET": render_template("buy....
0
votes
1answer
42 views

Pset8 Finance Register HTTP 500 error

I am working on the Finance PSET8 and am having trouble with the Register part of the problem. This is my application.py code @app.route("/register", methods=["GET", "POST&...
0
votes
1answer
195 views

Please rectify my C$50 Finance/register

I am getting an error message by debugger which is : builtins.TypeError TypeError: 'int' object is not subscriptable.
0
votes
1answer
338 views

Pset7 Index not outputting some fields in table

I am in desperate need of help, since the index method is the last method I have left to finish for this pset! So far, my index code works partially - as in, only the values I passed in from my ...
0
votes
1answer
157 views

Rectify implementation of register function in pset7 - finance (Flask)

def register(): """Register user.""" if request.method == "POST": if not request.form.get("username"): return apology("must provide username") elif not request....

1
2 3 4 5
9