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
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
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
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) ...
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
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
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
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
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", ...
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
0answers
6 views

database schema for finance PSET9

Just wondering what the best database design is for this particular pset. ATM I have a table for trades which serves to record all transacsatsions (buy and sell), each trade has an unique id, and ...
0
votes
1answer
16 views

Why is the portfolio not being displayed? I get not errors but nothing is being displayed. I am at a loss as to why I cannot display any stocks

@app.route("/") @login_required def index(): """Show portfolio of stocks""" rows = db.execute("SELECT symbol, SUM(shares) as Total_shares FROM ...
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
0answers
34 views

C$50 Finance: “:( sell handles valid sale expected to find ”56.00“ in page, but it wasn't found”

Check50 does not seem to think that the values in my table in index.html are updating correctly. After an afternoon of testing and searching through here and stackoverflow for similar issues, I cannot ...
0
votes
1answer
35 views

API key or look up function error in cs50 finance pset9?

I was working on the implementation of buy and trying to buy stocks when all of a sudden I began receiveing incorrect/invalid stock symbol for every stock symbol I tried(as if the stock symbol was not ...
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
0answers
48 views

Pset9 Finance| “Index table” doesn't display all the companies

I'm doing pset9 "Finance" and I've designed the two tables in the database, one with purchases and the other with transactions. Now when I render the index page, the shares of only one ...
0
votes
1answer
34 views

Runtime Error Unsupported Value in pset9 Finance

I'm doing Pset09 "Finance" and I have been stuck in the "index" function for quite a while. I tried to use the already existing "trans" table but I am getting an error. ...
0
votes
0answers
26 views

issue with my “Buy” code in finance problem set

There is a syntax error when I try to insert the buy information into my trade table. Here is my code. The issue is at the long db.execute line. Any guidance would be great. Thanks. def buy(): &...
0
votes
0answers
13 views

pset9 finance // expected to find “112.00” in page, but it wasn't found [duplicate]

Hi I was testing out my code for the buy function to buy a stock but once I tried to buy a stock it gave me this error: expected to find "112.00" in page, but it wasn't found and I am not ...
0
votes
1answer
41 views

pset9 buy function // buy handles invalid ticker symbol and handles valid purchase having error

I ran check50 to check some things that were wrong and I got 2 errors but when i check the details of the error it doesnt really give me a detailed overview of the problem so I am not really sure how ...
0
votes
0answers
24 views

Finance problem set. Register is not loading

I can not get the register page to load. I assume something is wrong with /register section of application.py, but can't find my problem. Any help is gratefully appreciated. Here is my code. @app....
0
votes
0answers
29 views

PSET 9Help with SyntaxError: invalid syntax error

The SyntaxError: invalid syntax error points me to line 75, but I cant see what is wrong there. Please I need help to identify possible reason. When i run Flask, the server crashes. 192.168.1.172 -...
0
votes
1answer
34 views

CS50 Finance check50 problem in sell function, it works fine when i test it as well but idk what the problem is

I tried my solution multiple times and compared it to the staff's solution as well but there is an check 50 error saying ":( sell handles valid sale expected to find "56.00" in page, ...
0
votes
2answers
32 views

What is the difference between Finance in 2020 and 2021

Please I want to ask What is the difference between Finance in 2020 and 2021. I have tried the problem set in 2020, I want to know as it might help em know how to proceed.
0
votes
1answer
41 views

pset9 finance // index function doesnt display the sum of the shares

I am doing pset9 finance and I am kind of stuck because whenever I buy for example FB stocks multiple times it doesn't sum up in to show in the index function. this is the code: @app.route("/&...
0
votes
1answer
38 views

PSET9 /Register exception raised in application: RecursionError: maximum recursion depth exceeded while calling a Python object

I'm having a weird issue with my register() and it was working before. Now it's giving me this error without touching this function: exception raised in application: RecursionError: maximum recursion ...
0
votes
1answer
26 views

pset9 finance // how can I check whether someone has registered

I ran a check50 and i found that its not checking if the user is in the database when registering so i decided to put a if statement which checks if the user is not added but it gives an error and i ...
0
votes
1answer
163 views

pset9 Finance “jinja2.exceptions.TemplateSyntaxError: expected name or number” error

In my index function, every time I try "flask run" it outputs that error (jinja2.exceptions.TemplateSyntaxError: expected name or number). Everywhere I've checked most people have been ...
0
votes
1answer
63 views

pset9 Finance - “ RuntimeError: unsupported value: ” error

(1) "buy" code in application.py: @app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): if request.method == "GET": ...
0
votes
0answers
55 views

PSet9 Finance: Check50 register function exception - 'NoneType' object not subscriptable

I recently completed Pset9 (everything seems to be running fine on the local server) and decided to run a check50 before submitting. However, Check50 marked two issues in my register function: "...
0
votes
0answers
42 views

Is there a bug in check50 cs50/problems/2021/x/finance?

I completed problem set 9 and works as supposed, but with check50 I get the following result: :( sell handles valid sale expected to find "56.00" in page, but it wasn't found For testing ...
0
votes
1answer
51 views

pset 9 Finance can't register or check for duplicates TemplateSyntaxError

I'm passing all register checks except for: :( registering user succeeds :( registration rejects duplicate username I've checked other answers and I've re-written the code a few times but I can't ...
0
votes
0answers
82 views

What's wrong with my register function? (Pset9 - Finance)

Here's my register function in application.py: @app.route("/register", methods=["GET", "POST"]) def register(): """Register user""" ...
0
votes
1answer
178 views

CS50 (2021) - Finance. :( registration rejects duplicate username - expected status code 200, but got 400

I´ve been struggling to complete the Pset9 - Finance, version from 2021. After reading multiple threads I decided to post here the issue, looking for some guidance so I can move forward in the course. ...
0
votes
2answers
69 views

PSET9 Finance: Check50 says Buy doesn't handle fractional/invalid shares, but when I try these things my page does reject them. Why check50 no like?

I have been using some of the html from the cs50 finance example page: https://finance.cs50.net/buy (which is permitted by CS50) I think it may be at the root of the problem. Here's the relevant html ...
0
votes
1answer
20 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
1answer
28 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
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
41 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/...
0
votes
2answers
108 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
15 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
49 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", "...
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
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 ...
0
votes
2answers
171 views

CS50 pset8 finance buy

I have been struggling with the buy portion of the finance assignment for CS50. I have created my new tables and written down the logic concerning buying stocks. When I run flask and try to purchase ...
0
votes
1answer
66 views

Blocked on C$50 Finance suggested personal touch feature - adapting index page to enable transactions in situ

Dug into the docs and trawled all the usual online sources but starting to suspect that I'm trying to solve this in a way that's impossible! This is how I've edited the index page to allow user input ...
0
votes
1answer
22 views

Finance - trouble implementing javascript

I am trying to set up my index page so that each stock in the user's portfolio has buttons to buy and sell said stock. The first step is working so far. Each row in the index table has buy and sell ...

1
2 3 4 5
9