Hi, this code works to fetch after hours ^SPX data from Yahoo Finance.
WL8 does not seem to support it in back test mode after hours.
This data is not available in streaming mode. Fine.
It would be nice if WL8 supported after hours one minute ^SPX from Y! in back test mode.
Thanks!
import yfinance as yf
import pandas as pd
import os
from datetime import datetime
symbol = "^SPX"
# Download recent 1-minute data
df = yf.download(
symbol,
period="5d", # recent days only
interval="1m",
auto_adjust=False,
progress=False
)
print(df.tail())
print(os.getcwd())
# Save to CSV
today = datetime.now().strftime("%Y%m%d")
filename = f"SPX_1m_{today}.csv"
df.to_csv(filename)
print(f"Saved {len(df)} rows to {filename}")
WL8 does not seem to support it in back test mode after hours.
This data is not available in streaming mode. Fine.
It would be nice if WL8 supported after hours one minute ^SPX from Y! in back test mode.
Thanks!
import yfinance as yf
import pandas as pd
import os
from datetime import datetime
symbol = "^SPX"
# Download recent 1-minute data
df = yf.download(
symbol,
period="5d", # recent days only
interval="1m",
auto_adjust=False,
progress=False
)
print(df.tail())
print(os.getcwd())
# Save to CSV
today = datetime.now().strftime("%Y%m%d")
filename = f"SPX_1m_{today}.csv"
df.to_csv(filename)
print(f"Saved {len(df)} rows to {filename}")
Rename
Correct. WealthLab's Yahoo! provider is EOD data only (and "streaming").
Yahoo! Finance doesn't have an official public API, is historically unreliable, and for these reason is generally not recommended for production use. I don't believe it's worth pursuing for this purpose when other integrated providers already support this data, like EODHD (GSPC.INDX), IQFeed, and possibly others.
I'd also argue that you could use SPY for the same purpose with any integrated intraday provider: All About WealthLab Intraday and Realtime Data Providers
Yahoo! Finance doesn't have an official public API, is historically unreliable, and for these reason is generally not recommended for production use. I don't believe it's worth pursuing for this purpose when other integrated providers already support this data, like EODHD (GSPC.INDX), IQFeed, and possibly others.
I'd also argue that you could use SPY for the same purpose with any integrated intraday provider: All About WealthLab Intraday and Realtime Data Providers
EOD is good enough for me.
Trying to overcome the single app number limitation of Schwab during development.
I have not been able to do a one-minute back test run using WL8 starter strategy code and Y!.
Trying to overcome the single app number limitation of Schwab during development.
I have not been able to do a one-minute back test run using WL8 starter strategy code and Y!.
Your Response
Post
Edit Post
Login is required