assetHistory(string Name, int Mode)

Loads price history of an asset from online servers, such as Yahoo™, or from the broker's server.

Parameters:

Name

Asset name used by Yahoo, or Quandl code, or 0 for the current asset.

Mode FROM_YAHOO - download daily (D1) price data from Yahoo Finance.
FROM_YAHOO|UNADJUSTED - use unadjusted prices.
FROM_QUANDL - download daily (D1) price data from Quandl (Zorro S required).
1 - download one-minute (M1) price data from the broker's server.
0 - download tick quote (T1) data from the broker's server (Zorro S required).

Remarks:

Example:

// Update M1 price history of all assets
function run()
{
  NumYears = 2;
  while(loop(Assets))
    assetHistory(Loop1,1);
  quit();
}

// Download AAPL D1 prices from Quandl
function main()
{
  assetHistory("YAHOO/AAPL",FROM_QUANDL);
}

See also:

price, asset, UpdateDays, loadStatus, Import, dataDownload

► latest version online