Invite ye felawes and frendes desirous in gold to enter the gates of Shrewd'm, for they will thanke ye later.
- Manlobbi
Investment Strategies / Mechanical Investing
No. of Recommendations: 6
I am working on a program to generate market signals similar to what GTR1 does (except for current). Alpha Vantage will only give me 100 days worth of SPY closing prices for free. Is there anyone willing to send me a year's worth of current data on SPY?. All I need is the date and closing price but I should be able to handle more.
Thanks,
Larry
No. of Recommendations: 7
No. of Recommendations: 5
Although it's a bit ugly, you can scrape the yahoo historical quotes page.
Pull it up, select all the data, cut, then paste it into Excel (edit/paste/special/text).
Dividends and splits are interspersed, you can split them out by sorting on 2nd column, which pushes them to the bottom, then re-sort the price lines by date.
I have a script which grabs the yahoo data which they have internally to 8 decimal places. All the columns. Splits & dividends in separate files. Easy peasy. If you want me to grab something for you just let me know.
No. of Recommendations: 10
Google Sheets. Set one up. One tab per index to follow. In the upper left of each sheet, put in this formula:
=googlefinance(".inx","all",today()-366,today(),"DAILY") --today()-### for however many days you want to go back.
Sorted by date descending:
=sort(googlefinance(".inx","all",today()-366,today(),"DAILY"),1,0)
Automatically updated as soon as you open it. No macros, no downloads, no scripts.
Not dividend adjusted, usually.
S&P = .inx
Russell 2000 use IJR
Nas = .ixic
S&P midcap = MDY
all the rest use the representative ETF symbol.
FC
No. of Recommendations: 2
Thanks Rayvt, Balthasar and FC,
Looks like I have lots of options to choose from.
Larry
No. of Recommendations: 9
Although it's a bit ugly, you can scrape the yahoo historical quotes page.
Pull it up, select all the data, cut, then paste it into Excel (edit/paste/special/text).
I believe you can not longer do that...on my browser, at least, they have managed to block the copy function.
But you can simply go to the history tab, choose your date range, then "File | Save As | xxx.txt", and open that file in Excel. The data table starts a couple of hundred lines from the top. You can get very deep history this way.
Jim
No. of Recommendations: 7
No. of Recommendations: 5
Try Tiingo. Works great for a limited number of tickers.
No. of Recommendations: 5
I believe you can not longer do that...on my browser, at least, they have managed to block the copy function.
But you can simply go to the history tab, choose your date range, then "File | Save As | xxx.txt", and open that file in Excel.
I just tried the copy and paste ^SPX under the history tab--several days worth, not a big selection--and it worked fine in my Firefox browser.
On the other hand, when I selected a date range--the 1 year button--I could not find an option for "File...." There is a Download button, but it's behind a paywall.
Eric Hines
No. of Recommendations: 7
I just tried it with Firefox.
1 year period, weekly
https://finance.yahoo.com/quote/JPM/history/?frequ...Then select with mouse the entire table, beginning with "Date", all the way down to the end of the table. Press ctrl-c (copy). Open up Excel then press ctrl-v (paste). Worked fine.
Grabbing a lot, like 10 years of daily prices, will try your patience.
Next way:
Go up to the toolbar line, "File Edit View .. etc."
Click File, then mouse down to "Save Page As..."
Set "Save as type:" to "Web Page, HTML only" then set the filename.
The data is in that file, but it is very human non-friendly.
No. of Recommendations: 7
Options to save the webpage will vary with browser. I can save Yahoo historical prices using Firefox save page as Text File.
In Firefox:
hamburger menu
Save Page As ... (Cntl S)
choose:
Webpage Complete
Webpage HTML only
Text Files
All Files
In Chrome:
3 dots menu
Cast, save, and share
Save Page As ... (Cntl S)
choose:
Webpage Complete
Webpage HTML only
Webpage Single File
No. of Recommendations: 5
I just tried the copy and paste ^SPX under the history tab--several days worth, not a big selection--and it worked fine in my Firefox browser. On the other hand, when I selected a date range--the 1 year button--I could not find an option for "File...." There is a Download button, but it's behind a paywall.
Interesting.
For me, if my mouse is anywhere over the data table it highlights that line with a grey background tint, and clicking anywhere in the table to start a selection does nothing. Clicking outside the table to start a selection highlights stuff outside the table (and copying that works), but ignores the table. Maybe one of my plugins, or one of yours.
No download button at all in the last several months, paywalled or not.
Glad I found the "save as" workaround, at least. For longer history it's quicker than the long slow highlighting/dragging I was using before they disabled the copy/paste.
Jim
No. of Recommendations: 6
For "a while" now, most websites have made it so that the only way you can grab data is to put the cursor in the first cell of the table, and click-drag down & across to the lower right of the table, keeping the cursor in the last cell of the table, ctrl-c or edit/copy, then pick a cell in your spreadsheet of choice and either paste, or paste-special values.
This is because they present (bury) the data in the response inside of javascript objects, so older & simpler methods like Excel's query/html or Google Sheets' IMPORTHTML table just get nothing.
With Barcharts, getting historical data added another tedious step - pasting puts every cell in one column. I had to write a gscript in Chrome's macro module to then parse each cell value into a 7 column wide row.
FC
No. of Recommendations: 8
With Barcharts, getting historical data added another tedious step - pasting puts every cell in one column. I had to write a gscript in Chrome's macro module to then parse each cell value into a 7 column wide row.
If you sign up for a free barcharts account, you can download a csv limited to 1000 rows.
Cut/paste is easy if you have a couple of Unix utilities. sed (to split every n'th row and paste (to put them all the fields of each symbol into one row).
I use cygwin on windows, but they might be native Windows versions.
Like this bat file script:
:: remove commas and CRs
sed -e '/Links/d' -e 's/\r//g' -e 's/,//g' nas-tech.txt >z0
sed -n "2~9p" z0 >z1
sed -n "3~9p" z0 >z2
sed -n "4~9p" z0 >z3
sed -n "5~9p" z0 >z4
sed -n "6~9p" z0 >z5
sed -n "7~9p" z0 >z6
sed -n "8~9p" z0 >z7
sed -n "9~9p" z0 >z8
sed -n "10~9p" z0 >z9
paste -d, z1 z2 z3 z4 z5 z6 z7 z8 z9 > nas-tech.csv
The sed "2~9p" means starting at line 2, print every 9th line. Because there are 9 fields per stock.
No. of Recommendations: 2
Yes, unfortunately it's limited to downloading one CSV per day with a free account.
FC
No. of Recommendations: 1
Yes, unfortunately it's limited to downloading one CSV per day with a free account.
One download per account.
Account = email address
Chrome, Brave, Firefox, Thorium, Vivaldi, Waterfox, etc. Lots of browsers available.
Free email addresses are easy to get.
Even so, only $99/yr.