assetHistory(string Name, int Mode)

Loads price history of an asset from online data providers or from a broker's price server at the begin of the simulation.

Parameters:

Name

Asset symbol or code used by the price source, or 0 for the current asset.

Mode

FROM_GOOGLE - download daily (D1) price data from Google™ Finance.
FROM_QUANDL - download daily (D1) price data from Quandl™ (Zorro S required).
FROM_AV - download daily (D1) price data from AlphaVantage™.
FROM_STOOQ - download daily (D1) price data from Stooq™.
FROM_YAHOO - download daily (D1) price data from Yahoo™ Finance (currently out of service).
+UNADJUSTED - use unadjusted prices.
1 - download unadjusted one-minute (M1) price data from the selected broker.
0 - download unadjusted tick quote (T1) data from the selected broker (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, Price History, dataDownload

► latest version online