Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.change field is wrong for some symbols when running after hours #55

Open
Beliavsky opened this issue Jan 27, 2025 · 0 comments
Open

.change field is wrong for some symbols when running after hours #55

Beliavsky opened this issue Jan 27, 2025 · 0 comments

Comments

@Beliavsky
Copy link

The .change field is wrong for some symbols when running the program after hours, returning the last stock price. For example, on Sunday evening, running

from datetime import datetime
from wallstreet import Stock, Call, Put

print("time:", datetime.now().strftime("%A, %Y-%m-%d %H:%M:%S"))
for symbol in ["SPY", "AAPL"]:
    s = Stock(symbol)
    print("\nsymbol:", symbol)
    print("s.price:", s.price)
    print("s.change:", s.change)
    print("s.last_trade:", s.last_trade)

gave

time: Sunday, 2025-01-26 19:38:53

symbol: SPY
s.price: 607.97
s.change: -1.7800293
s.last_trade: 24 Jan 2025 21:00:00

symbol: AAPL
s.price: 222.78
s.change: 222.78
s.last_trade: 24 Jan 2025 21:00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant