Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Yahoo Finance Data Download

    The Yahoo-finance data download command "returnsyh" has stopped working about two weeks ago. The error message is:
    "Yahoo does not have this symbol/range or could not be reached"; this is happening even for common symbols such as IBM.
    Is there a fix? Is anybody else experiencing the same problem?
    Atanu Saha

  • #2
    This command is part of the mvport package from SSC. If you get no answer here you can contact the author of the package. Please also read the Statalist FAQ, especially section 12.

    Comment


    • #3
      Yes, I have downloaded the mvport package and I have been using the returnsyh command for the last 2/3 years. But it is only recently (past one month) that it has stopped working. The error message is:

      "Yahoo does not have this symbol/range or could not be reached
      Please make sure you are online and/or redefine your range"


      Comment


      • #4
        Thanks for the error message but did you read the FAQ? Quote:

        Say exactly what you typed and exactly what Stata typed (or did) in response. N.B. exactly!
        Following the advice in the FAQ increases your chances of getting a helpful reply.

        Comment


        • #5
          Hi Atanu.
          I just found out that Yahoo changed its web link for users to download data using an API.
          I already modified the returnsyh.ado command. I will ask Chris Baum to update it.
          However, if you want to fix the problem now, you can do the following:
          1. Once you install the mvport package, open a do-file Window and open the returnsyh.ado, which is located at: c:\ado\plus\r\returns.ado (if you are using Stata for Mac, go to the corresponding directory where the user commands are installed)
          2. Go to line 13, and modify the Yahoo url:
          from
          local url = “http://ichart.finance.yahoo.com/table.csv” local url = "https://ichart.finance.yahoo.com/table.csv"
          1. Save the changes
          2. Go to the Command window and type the command discard

          This should work. In case you have a problem, let me know.

          Alberto Dorantes

          Comment


          • #6
            I had a problem when pasting my previous response. The steps you have to do are:


            1. Open a do-file Window and open the returnsyh.ado, which is located at: c:\ado\plus\r\returns.ado
            2. Go to line 13 of returns.ado code, and modify the Yahoo url:
            from
            local url = “http://ichart.finance.yahoo.com/table.csv”
            to:
            local url = "https://ichart.finance.yahoo.com/table.csv"
            3. Save the changes
            4. Go to the Command window and type the command discard

            This should work. In case you have a problem, let me know.

            Comment


            • #7
              Hi Alberto. I have same problem.

              returnsyh BAC, fm(1) fd(1) fy(2006) lm(11) ld(30) ly(2012) frequency(m) price(close)
              Yahoo does not have the ticker BAC or could not be reached
              Please make sure you are online and/or redefine your range
              no variables defined


              Comment


              • #8
                Hi Miguel. The command getsymbols replaced returnsyh. It has the same syntax, but now you can download data from other sources. Install the getsymbols from ssc and you can see examples in the help.

                Comment

                Working...
                X