Yahoo! Finance Database Issue with Fetch

조회 수: 10 (최근 30일)
Andrew Burns
Andrew Burns 2017년 3월 18일
댓글: Andrew Burns 2017년 3월 19일
Do any of you know of a way to remedy this issue?
When you fetch Yahoo data, and you pass a list of tickers and date ranges, there are times where some tickers in the list didn't trade within the particular date range. So what happens in the query ceases entirely. Ideally I'd want the returned data to just show NaNs for the dates that a particular issue didn't trade, next to the populated fields of other tickers that did trade and therefore have data.
As an example ... say I wanted adjusted close prices for 'IBM' and 'FB' (FaceBook) from May 2010 to today. IBM of course has been trading way before 2010, but FB didn't IPO until May '12 so from 2010 to May '12 there wouldn't be any data. So ideally I want to show NaNs for FB from 2010 to May '12 then the adjusted closing prices from May '12 to today.
Thanks in advance for any input.
Andrew

채택된 답변

Florian
Florian 2017년 3월 19일
Hi Andrew, the timeseries you get are not normalized. What I do is store the individual series in a structure and after downloading I -
  • Item one Item twoGenerate a list of all dates across all tickers
  • Item two Fill in all timeseries at their appropriate dates with ismember
This way you end up with an alligned price matrix across all tickers.
Hope this helps, Florian
  댓글 수: 1
Andrew Burns
Andrew Burns 2017년 3월 19일
Would you be able to share that part of your script so I can understand what you are saying better?
So as per my example, in your list you'd never be calling for data on FaceBook (ticker: FB) in a time period that there is no Yahoo! data for it?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Financial Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by