Skip to content

Commit

Permalink
Fixed premarket bug
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanAkkerman committed Sep 6, 2024
1 parent c20abd4 commit 0ef6e53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def append_price_data(price_key: str, prev_close_key: str):

# Determine which price to report based on market hours
if afterHours():
last_close = data["chart"]["indicators"]["quote"][0]["close"][-1]
last_close = data["chart"]["result"][0]["indicators"]["quote"][0]["close"][-1]
# Compare last close to current price
previous_close = stock_info.get("previousClose", last_close)
ah_change = (last_close - previous_close) / previous_close * 100
Expand Down

0 comments on commit 0ef6e53

Please sign in to comment.