Questions tagged [finance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
13 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
14 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
25 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
22 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
25 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
28 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
61 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
72 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
41 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
18 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
74 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
28 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
36 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
14 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
45 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
42 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
122 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
47 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
20 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 ...
0
votes
1answer
42 views

PSET8 Web Finance - Index/Portfolio - Why do my for loop variables not pull over to Portfolio.html?

I have the below code for my application: #valid stock row queries valid_stocks_rows = db.execute("SELECT symbol, SUM(shares) as sum_total FROM ledger WHERE user_id=:user_id GROUP BY symbol ...
0
votes
0answers
33 views

CS50 Web Track - Finance: OSError: [Errno 99] Cannot assign requested address

I'm trying to create a standard 'forgot password' feature for my web application. The issue is, when the user types in their email address and clicks submit to receive a token after which they can ...
0
votes
0answers
58 views

Finance - Buy Implementation

I am getting the error message "500 Internal Server Error" when trying to buy shares. Can you please tell me what I am missing? The application.py code is: @app.route("/buy", ...
0
votes
1answer
35 views

Week 8 - Finance - Buy - Getting Error Message Missing Shares

I'm trying to get the Buy implementation to work but I keep on getting the error message "Missing Shares" when I log into the cs50 finance site and enter in the symbol and number of shares. ...
0
votes
1answer
95 views

CS50 Finance Register

I was able to figure out the POST and /register, but I am confused on how to use INSERT a new user into users. Any help would be appreciated. Thank you. From application.py @app.route("/...
0
votes
2answers
33 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
39 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
3answers
33 views

pset8 Finance History - rows repeat in the table in number of times per length of rows

Do not know the reasons why the row in the HTML table will repeat in number of times per the length of rows. Please see my codes as follows: application.py rows = db.execute("SELECT * FROM ...
0
votes
1answer
42 views

FINANCE: GROUP BY doesn't add up the numbers of shares of the same stock

So in index i'm trying to display a table with all the stocks that the user has bought, one row for each stock, displaying the total number of shares in the user's portfolio along with the total value ...
0
votes
0answers
15 views

FINANCE: how to commafy numbers in jinja?

I was wondering about how to commafy large digits in jinja so that instead of [$10000 / $100000 / $1000000] these numbers would be displayed as such [$10,000 / $100,000 / $1,000,000] I've been looking ...
0
votes
1answer
77 views

Problem Set 8 / Finance. How to incorporate current price (index)

I'm currently struggling with index(). In buy() I created the custom table with, one might say, too many columns. Among others are symbol, name, shares, price, total. So far I was able to plug some of ...
0
votes
1answer
21 views

KeyError: 'price_per_share': Webtrack CS50

I am currently trying to complete finance, but got the "Internal Server Error" apology along with the KeyError in the title when trying to run index. Below is the error text I received and ...
0
votes
0answers
10 views

finance ensure integer input using int()

I noticed that finance.cs50.net when I give an input like suppose 5.0 it gives an error. Is there any way to replicate it as using the int() function doesn't work?
0
votes
1answer
89 views

PSET8 Finance Buy. SQL query not executing

My buy function is crashing at the SQL query where I'm trying to insert data from the transaction into a transactions table. The types of each column are transaction_id(integer, primary key), user_id(...
0
votes
0answers
17 views

Jinja scope help

def index(): """Show portfolio of stocks""" price = [] num = int(db.execute("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='tracker'&...
0
votes
1answer
56 views

set8 tracks/finance cs50

Im getting error 500 messages, when it should instead show the index page after buying or when clicking on history and sell. This is my code for index(). def index(): """Show ...
0
votes
1answer
26 views

finance cosntraint syntax error

def buy(): """Buy shares of stock""" if request.method == "GET": return render_template("buy.html") else: if not request....
0
votes
1answer
19 views

Finance sql doubt

I would like to know if there is a way to insert certain set of values replacing the older ones ie without creating duplicates
0
votes
1answer
23 views

Web track finance error sql

def buy(): """Buy shares of stock""" if request.method == "GET": return render_template("buy.html") else: if not request....
0
votes
1answer
13 views

Web track finance error

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "GET"...
0
votes
2answers
82 views

Finance Register Checking for Duplicate Username Not Working

I've looked at lots of other questions with people who have code for register, and my SQL code is exactly the same as most of them, but when I register, it lets multiple people have the same username. ...
0
votes
1answer
79 views

CS50 Finance Internal Server Error RuntimeError: near “' '”: syntax error

I'm working on the register section of application.py. When I've typed in the username and password and hit register, I get an internal server error. I'm assuming that pbkdf2:sha256:150000$uJ2F7qcX$...
1
vote
1answer
30 views

INDEX only pulling row of data from database

For the life of me I cannot get my index page to properly display the data from my database. I have tried multiple methods and research on several sites. I'm thinking it is something right in front of ...
1
vote
1answer
121 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
71 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
1answer
153 views

Finance index function does not return lookup value in index.html

I'm trying to render my lookup values inside of my index function implementation, but I cannot get these values to render in my index.html page. I added share = lookup(record['share_symbol']) to grab ...
0
votes
1answer
35 views

Finance index.html is not rendering values from my index function

I'm having some issues trying to render values on my index.html page. In my index function, I created a dictionary of values from my transactions table to grab each record of my share symbols, share ...
0
votes
1answer
121 views

Finance history, runtime error(“unsupported value: {}”.format(value))

After creating a table to handle and record all transactions, I seem to run into problems with my buy and sell functions when I try to update the history table. Specifically this line of code: # ...
0
votes
1answer
210 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: ...

1
2 3 4 5
9