Questions tagged [finance]

The tag has no usage guidance.

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

pset9 Finance Check50 bot says submission button not found

I have completed my application for pset9 and have all functions working properly, however check50 doesn't agree with my register implementation. Apparently, I do not have a submission button, however ...
user avatar
0 votes
0 answers
16 views

RuntimeError: near "GROUP": syntax error

transaction_db = db.execute("SELECT symbol, SUM(number) AS number, price FROM new WHERE user_id = ? GROUP BY symbols", user_id) RuntimeError: near "GROUP": syntax error
user avatar
0 votes
0 answers
17 views

PSET9 Finance: USD function returns error only when both rendering Index AND after BUY completes a 'purchase'

"unsupported format string passed to Undefined.format"--I know this happens because the non-numerical value is passed into the USD function, but I can't seem to spot the culprit. As ...
user avatar
0 votes
1 answer
27 views

PSET9 FINANCE SQLITE "no such column exists" while multiplying two columns to update a third

In the Index function on APP.PY of my finance code, I'm getting "RuntimeError: no such column: total_per_share" even though I'm using "AS" to create this column -- please advise. @...
user avatar
1 vote
1 answer
18 views

cs50 finance - RuntimeError: unsupported value: <function buy at 0x7f1c380cfd90>

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

Here is my cs50 finance /buy code

@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy shares of stock""" if request.method == "POST": ...
user avatar
  • 15
0 votes
1 answer
28 views

my cs50 finance buy do not update in in the portfolio

i have tried so many options but to no avail pls below are the code i wrote.`@app.route("/buy", methods=["GET", "POST"]) @login_required def buy(): """Buy ...
user avatar
  • 15
0 votes
0 answers
6 views

PSET 9: Should I use a separate table for symbols?

Symbols will repeat themselves, since different users can buy shares from the same company, so when creating the portfolio table to store data related to the purchase of shares, I thought I could ...
user avatar
0 votes
1 answer
15 views

PSET 9: C$50 Finance. Why not <input type="number"> instead of text?

From CS50's Problem Set 9 specification: Require that a user input a number of shares, implemented as a text field whose name is shares. Render an apology if the input is not a positive integer. I'm ...
user avatar
0 votes
1 answer
66 views

400 error on login after 302 redirect

I am getting a 400 error after opening the site, e.g., https://USERNAME-code50-#######-#########-5000.githubpreview.dev/. From the network request log I see a 302 redirect to https://github.com/...
user avatar
0 votes
0 answers
37 views

finance problem 112.00 (timebound)

:( buy handles valid purchase Cause expected to find "112.00" in page, but it wasn't found Log sending GET request to /signin sending POST request to /login sending POST request to /buy ...
user avatar
0 votes
1 answer
39 views

Flask/Python PSET9 Finance -- Using PRINT() to debug

Having some problems with INDEX that I figure printing variable content to console will help me solve. BUT no matter what I try, print(variable) doesn't result in anything at all on the console/...
user avatar
0 votes
0 answers
27 views

exception raised in application: RuntimeError: no such table: stocks

from cs50 import SQL from flask import Flask, flash, redirect, render_template, request, session from flask.helpers import get_flashed_messages from flask_session import Session from helpers import ...
user avatar
0 votes
0 answers
20 views

PSET9 finance: lookup always returns 404 None or 200 None

I reinstalled helpers.py and the entire IEX key is being submitted (IEX console shows credit is being used--see attached photo) but I keep getting: https://cloud.iexapis.com:443 "GET /stable/...
user avatar
0 votes
1 answer
80 views

ValueError: UNIQUE constraint failed: on finance pset9, could someone point me in the right direction on which values should be UNIQUE from my table?

Could someone help me figure out which values should I define as UNIQUE? I'm getting the ValueError: UNIQUE constraint failed: compras.id beacuase of the way I created my table for keeping tab of who ...
user avatar
0 votes
0 answers
16 views

cs50 Finance Invalid Syntax on function declaration

When working on Finance I encountered a syntax problem which higlights a function declaration def buy(): ^ SyntaxError: invalid syntax. I have a feeling that because such an obvious thing was ...
user avatar
0 votes
0 answers
31 views

What is the best approach to DB design? (CS50X PSET9)

I'm pretty excited going over the pset9, however, I have a question when it comes to db design. The following text might be a spoiler to the solution of the problem set, beware. Given the above ...
user avatar
0 votes
1 answer
35 views

FINANCE SELL : DROPDOWN MENU not showing any option DESPITE having look for solutions

This is my first time posting on reddit asking for help : I've been so far going through cs50 on ressources online when I got stuck, but here I can't figure it out even tho with the numerous online ...
user avatar
  • 1
0 votes
1 answer
62 views

PSET9 Finance- Check50 error - sell page has all required elements - expected to find input field with name "shares", but none found

I get an error when I run the check50 command for Finance problem set. The sell.html template is below: {% extends "layout.html" %} {% block title %} Sell {% endblock %} {% block main %...
user avatar
0 votes
1 answer
128 views

PSET9 Finance - Check50 Failing on login - logging in as registered user succceeds - IndexError: list index out of range

I have been struggling with the Finance problem for a while. Upon running the check50 command, I get the following error: :( logging in as registered user succceeds Cause application raised an ...
user avatar
0 votes
1 answer
12 views

Key error(hash) in login function

If len (rows) != 1 or not check_password_hash (rows [0]["hash"], request.form.get ("password")): Return apology ("invalid username and/or password") The following ...
user avatar
0 votes
0 answers
75 views

Pset9 - Finance sell function not working

Can anyone help me with this problem? check50 keeps returning these lines, but I don't know what is the problem, since the web application works fine when I test it manually. :( sell handles invalid ...
user avatar
0 votes
0 answers
50 views

How do you check if a value is fractional? HEAR ME OUT FIRST

This is from cs50 finance: Text: :( buy handles fractional, negative, and non-numeric shares Cause application raised an exception (see the log for more details) Log sending POST request to /login ...
user avatar
0 votes
0 answers
39 views

The predefined login function psets/9/finance error

Have a problem with check50. I'm able to register, log in and all but check50 keeps denying it (the login part): :) application.py exists checking that application.py exists... :) application ...
user avatar
0 votes
0 answers
16 views

Finance: how does the "errorhandler" work?

I am trying to understand the errorhandler function in pset9 finance. In the given application.py: # Original version def errorhandler(e): """Handle error""" if ...
user avatar
  • 1
0 votes
1 answer
70 views

Cs50 Finance :(sell handle valid sales :values appearing in index table but check50 doesnt recognise it

updated the code to display history properly,ie when sold shows negative,and when bought shows positive updated index to remove entire row when stocks is 0 I cant figure out why check 50 is not ...
user avatar
  • 1
0 votes
0 answers
20 views

NameError in Pset: Finance

Cause application raised an exception (see the log for more details) Log sending POST request to /login sending POST request to /buy exception raised in application: NameError: name 'stock' is not ...
user avatar
0 votes
1 answer
42 views

Getting error in pset8 Finance

I get this error in register in pset8/finance when I run check50: :) application.py exists :) application starts up :) register page has all required elements :( registering user succeeds expected ...
user avatar
0 votes
1 answer
74 views

Check50 says buy allows fractional, negative numbers but it doesn't. Where am I going wrong?

I'm down to my last check50 frown (:( buy handles fractional, negative, and non-numeric shares expected status code 400, but got 200) but my code doesn't allow for these, so I don't know what to do. ...
user avatar
  • 14
0 votes
0 answers
25 views

I have an error in register function (Week9 Finance)

I would like to ask for your help please with an error I keep getting on my code for the week 9 Finance. I have been receiving like this Here is my login/ register function below. @app.route("/...
user avatar
  • 1
0 votes
0 answers
75 views

Week9, Finance " :| logging in as registered user succeeds "

I would like to ask for your help please with an error I keep getting on my code for the week 9 Finance. I have been receiving :| logging in as registered user succceeds can't check until a frown ...
user avatar
  • 1
0 votes
0 answers
91 views

" can't check until a frown turns upside down " annoys me (Finance, week9)

I got like this: :| quote page has all required elements can't check until a frown turns upside down :| quote handles invalid ticker symbol can't check until a frown turns upside down :| quote ...
user avatar
  • 1
0 votes
0 answers
29 views

CS50 Finance Error: Expected something but got other

I'm struggling with register function in application.py since I am having error messages in check50 That says: :) register page has all required elements :( registering user succeeds expected ...
user avatar
  • 1
0 votes
0 answers
125 views

CS50 Week9 Finance I have an error in register

I'm struggling with register function in application.py since I am having error messages in check50 That says: :) register page has all required elements :( registering user succeeds expected ...
user avatar
  • 1
0 votes
1 answer
76 views

Why does my lookup function keep returning "None"?

I have the latest (I think) distribution code and I have exported the API key. Here is my code and it keeps returning 'None'. I can't figure out why I can't look up a stock quote. Do I need to change ...
user avatar
  • 14
0 votes
0 answers
22 views

How do I get an API key from IEX?

I've just started on pset9 finance, but I can't create an account with IEX. When I try, it tells me that my email address is already in use (this is definitely not true - I'm using a relatively new ...
user avatar
0 votes
1 answer
48 views

Finance (buy) having trouble to update the table

So I'm trying to update the "share" column in an existing row in the table portfolio instead of creating a new one when buying a stock that the user already has, here is my code: def buy(): ...
user avatar
0 votes
1 answer
34 views

Finance - register: Always getting 500 error

I am struggling with the implementation of register. I started small, just copied the content of the already defined login-function as well as the content of login.html. So, my first attempt is just ...
user avatar
  • 5
0 votes
1 answer
71 views

pset9: finance // jinja syntax error in index

I'm working on my index page and I have two errors. For the first, I'm not sure what's wrong. It seems like it's something with my return statement but I have no idea what's wrong with it. File "...
user avatar
  • 3
0 votes
1 answer
86 views

I'm on pset9 right now and I'm running check50 on my code and getting :( logging in as registered user succeeds expected status code 200, but got 403

I've tried everything that I thought could be the problem but nothing is working. I registered and tried logging in but I keep getting '403 Invalid username and/or password' error This is my login ...
user avatar
0 votes
0 answers
37 views

CS50X Finance: check50 says buy isn't handling valid purchase. But it is handling fine

I'm wondering what is being tested because its looking for the value 112. expected to find "112.00" in page, but it wasn't found I'm flashing the result of the buy transaction on the index....
user avatar
0 votes
0 answers
56 views

Pset Finance - issue with usd

I'm stuck with pset9 Finance... When I try to sell a quote and return to index.html, I have an error with : File "/home/ubuntu/pset9/finance/templates/index.html", line 1, in top-level ...
user avatar
0 votes
1 answer
102 views

check50 errors for "buy" and "sell"

I get below errors from check50: :( buy handles invalid ticker symbol application raised an exception (see the log for more details) :( buy handles fractional, negative, and non-numeric shares ...
user avatar
  • 1
0 votes
1 answer
56 views

What mistake am I doing in the below "buy" and "sell" code.? I get the below errors from check50

I get the below error from check50: :( buy handles invalid ticker symbol application raised an exception (see the log for more details) :( buy handles fractional, negative, and non-numeric shares ...
user avatar
  • 1
0 votes
0 answers
16 views

What mistake am I doing for the below "sell" code.?

What mistake am I doing for the below "sell" code: @app.route("/sell", methods=["GET", "POST"]) @login_required def sell(): """Sell shares of ...
user avatar
  • 1
0 votes
0 answers
18 views

Why can't I update the Cash balance.? It only shows the balance that was deducted the first time only

application.py @app.route("/") @login_required def index(): """Show portfolio of stocks""" # Select symbol owned by user and its quantity purchases ...
user avatar
  • 1
0 votes
1 answer
140 views

Pset 9 Finance index function, current stock price not displaying correctly

I am working on getting the proper information to display on the index page. I have one piece left, and it is displaying the current value of the stock. When I look at my output for my 'user' and '...
user avatar
0 votes
0 answers
51 views

ADD EXTRA CASH IN FINANCE

Trying to add extra cash to my pset finance. I have made as you can see below in the picture, that is adding an extra part of code to the index function(), but I'm just getting a 404 answer. Why is it ...
user avatar
0 votes
1 answer
156 views

CS50 Finance index doesn't display what it needs to

I'm at the last check for the 'buy' part and I keep getting: :( buy handles valid purchase expected to find "9,888.00" in page, but it wasn't found I'm pretty sure that number is supposed to ...
user avatar
  • 3
0 votes
1 answer
43 views

Buy/Sell on Index - button attributes & form value issues

I've got a couple issues adding my own buy/sell buttons to the index page. First, each "Buy" or "Sell" buttons opens up the form for all of the table rows. How can I modify these ...
user avatar
  • 1

1
2 3 4 5
10