{"id":65,"date":"2007-08-04T14:19:35","date_gmt":"2007-08-04T19:19:35","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/2007\/08\/04\/amiquote-and-free-data-from-yahoo\/"},"modified":"2017-07-25T11:34:15","modified_gmt":"2017-07-25T10:34:15","slug":"amiquote-and-free-data-from-yahoo","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2007\/08\/04\/amiquote-and-free-data-from-yahoo\/","title":{"rendered":"AmiQuote and free data from Yahoo"},"content":{"rendered":"

There are a couple of things you need to know about Yahoo Finance pages that AmiQuote uses to download “historical” and “current” quotes.<\/p>

Current quotes are quotes for current day (or previous day if there is no trading session today). For example MSFT current quote page is here:
http:\/\/finance.yahoo.com\/q?s=MSFT<\/a>
AmiQuote uses rather “download data” link which is:
http:\/\/download.finance.yahoo.com\/d\/quotes.csv?s=MSFT&f=sl1d1t1c1ohgv&e=.csv<\/a>
But it is not relevant because both show same current quote.<\/p>

Now there is a second source. Historical quotes are downloaded from Historical Prices page. For example MSFT historical page is here: https:\/\/finance.yahoo.com\/quote\/MSFT\/history?p=MSFT<\/a> (again AmiQuote uses rather plain text link “Download data” (URL is dynamic, so you must click on “Download data” link on Yahoo page)<\/p>

Why using two sources? That’s simple: current mode gives data during trading session, while historical is only updated many hours after markets close so both compliment each other. Current mode is also much faster as it downloads as many as 200 symbols at once, while historical must download one by one. So recommended usage is to use Yahoo Current mode everyday, and Yahoo Historical once a week.
Of course you may use historical everyday as well if you have time and fast internet connection.<\/p>

It is important to understand that AmiQuote is just the downloader (like Internet Explorer) and it does nothing except downloading the data, so if you belive that there is a bad quote – it is not AmiQuote, but rather Yahoo problem. To verify always go to relevant page (see links above) and check the quote on Yahoo Finance site directly.<\/p>

It may happen that quotes on Yahoo Current page and Yahoo Historical pages differ. It is so because Yahoo gets them from different data vendors. If this happens the only solution is to report data error to Yahoo.<\/p>

There are however 2 things you need to know about importing of data:<\/p>

  1. AmiBroker by default imports split adjusted data <\/strong>(“Open, High, Low, Close” on Yahoo Historical page). For more information on how data are adjusted see Yahoo Help page at: http:\/\/help.yahoo.com\/l\/us\/yahoo\/finance\/quotes\/quote-12.html<\/a>
  2. You can change it to import split-and-dividend adjusted<\/strong> data (“Adj. Close” on Yahoo Historical Page) as described below<\/ol>

    These things are adjustable, so if you don’t like them, you can change them.
    The import process of historical quotes is controlled using aqh.format<\/strong> file that you will find inside “Formats” subfolder. By default it looks as follows (you can open it with Windows Notepad).<\/p>

    # AmiQuote historical quotes download format (.AQH extension)
    $FORMAT Date_DMY,Open,High,Low,Close,Skip,Volume<\/strong>
    $SKIPLINES 0
    $BREAKONERR 0
    $SEPARATOR ,
    $DEBUG 1
    $AUTOADD 1
    $CONT 1
    $GROUP 254
    <\/code><\/p>

    Lines marked with bold mark important areas.<\/p>

    $FORMAT line controls the import format.
    Yahoo currently delivers only ADJUSTED data. But they are adjusted in two ways. First way is just adjusting for splits. And these data are downloaded by default.
    Additionally Yahoo has “Adj. Close” column that provides close price adjusted for splits AND dividends.
    You can download data adjusted for splits AND dividends by changing aqh.format file.
    AdjClose field says that AmiBroker should use adjusted price. If you want prices adjusted for both splits and dividends simply replace $FORMAT line with:<\/p>

    $FORMAT Date_DMY,Open,High,Low,Close,AdjClose,Volume<\/code>
    (note AdjClose in place of Skip field)<\/p>

    $VOLFACTOR line controls the volume multiplier. If you want volume to be expressed in single shares instead of hundreds of shares replace $VOLFACTOR line with:<\/p>

    $VOLFACTOR 1<\/code><\/p>

    The same $VOLFACTOR change should be applied to aqd.format<\/strong> file that is responsible for importing data in Yahoo CURRENT mode (if you are using it).<\/p>","protected":false},"excerpt":{"rendered":"

    There are a couple of things you need to know about Yahoo Finance pages that AmiQuote uses to download “historical” and “current” quotes.Current quotes are quotes for current day (or previous day if there is no trading session today). For example MSFT current quote page is here:http:\/\/finance.yahoo.com\/q?s=MSFTAmiQuote uses rather “download data” link which is: http:\/\/download.finance.yahoo.com\/d\/quotes.csv?s=MSFT&f=sl1d1t1c1ohgv&e=.csvBut […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,5],"tags":[51,54],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/65"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=65"}],"version-history":[{"count":2,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/65\/revisions"}],"predecessor-version":[{"id":1474,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/65\/revisions\/1474"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=65"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=65"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=65"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}