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


    If the market is open, yesterdays close is historical data - you could alway spam Yahoo
  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


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

  5. you can also do this in tradelink in any .net language.

    here is c# example :

    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);
                   Console.WriteLine("spy closing price mismatch.");