Get Last day close price for 300 stocks

Discussion in 'Automated Trading' started by sungtaeyoo, Sep 23, 2010.

  1. I'm using IB APIs but its GetHistoryData() limits 60 times in 10 mins. Is there different way to get last day's close price?
     
  2. promagma

    promagma

    If the market is open, yesterdays close is historical data - you could alway spam Yahoo
    Code:
    http://ichart.finance.yahoo.com/table.csv?s=AAPL&a=08&b=22&c=2010&d=08&e=22&f=2010&g=d&ignore=.csv
     
  3. Actually what I want is after maket close(so about 1:30), I'd like to get 300 stock's that day's close price. Now the only way I can do is call GetHistoryData() 60 times for the first 60 stocks and then Sleep for11 mins and then call GetHistoryData() 60 times for next 60 stocks and so on. So it will take about an hour.
     
  4. promagma

    promagma

    Ah, that's even easier, with Yahoo you can get current quotes in bulk

    Code:
    http://download.finance.yahoo.com/d/quotes.csv?s=AAPL,RIMM,GOOG&f=sl1d1t1c1ohgv&e=.csv
     
  5. you can also do this in tradelink in any .net language.

    here is c# example :

    Code:
    using TradeLink.API;
    using TradeLink.Common;
    
    class Program
    {
       static void Main(string[] args)
       {
              // the DayFrom* methods get daily bar data (eg 1year) from respective provider
              BarList google = BarListImpl.DayFromGoogle("SPY");
              BarList yahoo = BarListImpl.DayFromYahoo("SPY");
              if (google.RecentBar.Close==yahoo.RecentBar.Close)
                   Console.WriteLine("SPY close: "+google.RecentBar.Close);
              else
                   Console.WriteLine("spy closing price mismatch.");
       }
    }
    
    http://tradelink.googlecode.com