Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Q: how to read terminal window and debug in Finance?

I am receiving errors (in red) in my terminal window. However I'm not understanding what those errors actually mean. Can someone help direct me on how to 1) read the error 2) find out where exactly ...
0
votes
1answer
60 views

When stock and user exist, update (PSET8)

I'm trying to make it check if the user already owns this stock, and if they do, then to update the portfolio. I'm confused about how to get this code to work as I don't understand how to check if it ...
0
votes
2answers
129 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
24 views

PSET 9 Finance index.html issue with displaying table results with html

I'm currently on CS50 PSET 9 Finance and stuck on the index.html portion of the assignment. This is my code from assignment.py: @app.route("/") @login_required def index(): stocks = db....
0
votes
1answer
37 views

Update portfolio on duplicate id and stock

So I think I know where the problem is, it's trying to update the variable shares taken from the form, and add the shares from the form and the new amount of shares, which is not helpful. I need to ...
0
votes
1answer
192 views

PSET8 Finance Buy

For some reason, my buy function will not work. When I try to "buy" a share of stock, it always goes to internal server error. Here is my code: def buy(): if request.method == "POST&...
0
votes
1answer
21 views

PSET 8 Finance “:( buy handles valid purchase exception raised in application: TypeError: 'method' object is not subscriptable”

I've been having a problem with CHECK50, I cant seem to find the right object to change. This is the log I get sending GET request to /signin sending POST request to /login sending POST request to /...
0
votes
1answer
517 views

Problem Set 8 / Web Track - Finance (Redirect Error)

My functions seens to work fine, but when i have that redirect the user to the homepage (redirect("/")) the application crash and show the error message: 500 internal server error and I don't know if ...
0
votes
1answer
350 views

IndexError: list index out of range in Finance

When I sell a stock on my website, an error pops up. The Terminal shows that in the sell() function, this line's index is out of range user_shares = int(db.execute("Select Shares from Portfolio ...
0
votes
1answer
266 views

Struggling with error on CS50 Finance Problem - expected status code 200, but got 400

I would like to ask for your help please with an error I keep getting on my code for the Finance problem. I can't seem to find a solution for it :/ I keep receiving: :) application.py exists :) ...
0
votes
1answer
22 views

How to disable a button after it was clicked ? finance-pset7

I would like to add a button (Give me $12.000) to my index.html. The purpose is that a user can only once receive additional cash = 12000 by clicking that button. After a click, I do not want to ...
0
votes
1answer
44 views

pset7 finance where to write buy

I'm having trouble on buy because I'm not sure where to write the html, it doesn't specify where to write the inputs for but and I'm confused about where to write that, do I make a buy.html? I have ...
0
votes
1answer
74 views

Javascript isn't running at all in pset8 check

I'm not sure how to run my javascript in pset 8. I used a normal script tag to link it in my register/html file. I'm not sure I need to link it from the application file. Do I need all the JS to be ...
0
votes
1answer
21 views

check50 on finance pset

I'm having 2 problemas with my check50: :( buy handles fractional, negative, and non-numeric shares :( sell handles invalid number of shares As shown in the code below, my input in buy and sell is ...
0
votes
1answer
21 views

Buy Finance Pset9 Cash not working

I am working on pset9 finance and I have been stuck for a while on it, especially this part: cash = db.execute("SELECT cash FROM users WHERE user_id = :userid", userid= ...
0
votes
1answer
39 views

Why table is not inserting here in buy route

Hello Folks! I am working on paset8, why table is not inserting into buy route
0
votes
1answer
90 views

unindent error on the template given

I have been stuck on pset7 finance due to an error called 'unexpected unident'. It is giving me an error on the @app.route("/history) portion, the arrow is specifically pointing to the @ symbol. I ...
0
votes
1answer
11 views

Problems when deploying “Problem9: Finance” to Google cloud platform

I'm trying to deploy "finance" to the google cloud platform. My solution passed the check50 test 100%. To deploy it to the google cloud platform, I kept all the ordinary code, only removed ...
0
votes
0answers
17 views

PS9 Finance - Check50 - :( buy handles valid purchase

I am running into an issue with check50 on my buy function. Check50 gives me the following error: :( buy handles valid purchase Cause application raised an exception (see the log for more details) ...
1
vote
2answers
629 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
48 views

PSET 9 Quote function not working correctly

Lookup function always returns "None". Weirdly the same code produced correct results yesterday but as of today it stopped. Any thoughts why? The code for the quoted.html and application.py ...
0
votes
1answer
114 views

I'm making a route “/Account” to allow user to change password. I'm a bit confused about GET and POST requests

I thought I sort of understood GET and POST requests in that: GET request means the user only retrieves data from the server; cannot change anything like the database POST request means the user can ...
0
votes
1answer
62 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
499 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
1answer
389 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 ...
0
votes
1answer
26 views

Pset9 Finance Sell select menu

I'm doing the "sell" part of the Finance pset. I am trying to display the stocks someone is able to sell on a HTML page with a select menu. The problem is that they don't display properly on ...
0
votes
1answer
85 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
0answers
12 views

Week 9 - Finance. How could I check de return?

I am coding the week 9 problem (Finance) and I am part of (quote) and I have some doubts. The lookup () function returns (none) if the API does not find (stock). I am interested in how I check using ...
0
votes
1answer
38 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
42 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
0answers
17 views

my check 50 compiler is saying “can't check until a frown turns upside down” [closed]

import os from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask_session import Session from tempfile import mkdtemp from werkzeug.exceptions ...
0
votes
1answer
115 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....
1
vote
1answer
158 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
0answers
8 views

Index route_TypeError: 'NoneType' object is not subscriptable

I tried to run the program and encountered this error: My code: @app.route("/") @login_required def index(): """Show portfolio of stocks""" # Selecting ...
0
votes
1answer
69 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
18 views

Pset9 Finance - How do I load the symbol into my input box on the Buy.html?

I am successfully getting the symbol from the button (as see in image) but I am not sure how load it into the text field as value to be submitted. Please help.... @app.route("/buy", ...
1
vote
3answers
426 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? ...
0
votes
2answers
40 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
2answers
48 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
65 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 ...
1
vote
1answer
101 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 ...
0
votes
1answer
78 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 ...
1
vote
1answer
66 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
126 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 ...
1
vote
1answer
362 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
227 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
18 views

How to access the values returned by SELECT SUM

I am trying to create the table in pset9 finance to display what stocks the user has. My current attempt tries to do this by summing up the number of stocks in past transactions the user has made. I ...
0
votes
2answers
115 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
311 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
1answer
108 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 ...

1
2 3 4 5
9