Skip to content

Commit

Permalink
Daily and All stock view succesfully configured
Browse files Browse the repository at this point in the history
  • Loading branch information
eethansmith committed Dec 12, 2023
1 parent a9e2a33 commit c7d1590
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
Binary file modified backend/myapp/__pycache__/graph_stock_holdings.cpython-38.pyc
Binary file not shown.
4 changes: 0 additions & 4 deletions backend/myapp/graph_stock_holdings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ def get_stock_history(request, ticker):
stock = yf.Ticker(ticker)
historical_prices = stock.history(start=start_date.strftime('%Y-%m-%d'), end=end_date.strftime('%Y-%m-%d'))

# Check if data is sparse and fetch hourly data if necessary
if len(historical_prices) < 80:
historical_prices = stock.history(period="1mo", interval="1h")

historical_values = []
current_shares = 0
value_paid = 0
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/StockGraphing.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function StockGraph({ ticker, timeFrame }) { // Use destructuring to get the tic

useEffect(() => {
// Ensure the ticker value is included in the fetch URL
if (timeFrame == 'All') {
if (timeFrame === 'All') {
fetch(`http://localhost:8000/api/graph_stock/${ticker}/`)
.then(response => response.json())
.then(data => setStockData(data))
Expand Down

0 comments on commit c7d1590

Please sign in to comment.