Where/how to get exchange-specific historical data for stocks

Discussion in 'Data Sets and Feeds' started by avatar-ds, Nov 28, 2019.

  1. I'm looking for historical daily data for liquid US stocks confined to trades registered directly on major exchanges (i.e. just NYSE and NASDAQ). My rationale is I need the reliable bulk of statistics for daily Highs and Lows while it looks like the consolidated tape for some stocks can get mighty noisy with small time dark pool trades at extreme prices, driving my back-tests into impractical considerations. I’d like to avoid, for the time being, the need to crunch historical intraday ticks myself which would allow sifting through the volumes with the best precision but at the moment looks like an overkill as I believe the bulk of trades at major exchanges will be enough to shape the statistics into a much more sensible working range, and must be available separately anyway. Hopefully, reasonably priced (non-professional) and going back to well before the GFC (2001-2004 latest).

    Appreciate any help.
     
  2. ZBZB

    ZBZB

  3. Ates

    Ates

    If you have programming skills, i would go for AlphaVantage or Alpaca
    I'm not sure how far can you go with them. For intraday (1min - 60min) they provide last 1000 bars i believe. Go ahead and check yourself
     
  4. In case you have an IB account you could use their data. I'm not sure how far back they hold data though.
     
  5. Thanks for the replies, I'm working through the sources suggested.

    I believe Quandl have the data feeds confined to the two major exchanges. Sent a request to them to confirm that this is what I'm looking for. Price looks a bit steep though as they only offer annual subscription. Still within my reach but pushes me harder towards the option of reconciling with IB API limitations.

    AlphaVantage, Alpaca - from the docs these don't seem to offer a way to get exchange-bound historical trades.

    HobbyTrading, thanks, I'm on IB indeed but I was under the wrong impression that unlike the time and sales tick data their historical bars didn’t allow to sort out the trading venues. After a few experiments with the API requests it looks like there are actually some limited possibilities to do this as it allows to confine the bars to the primary listing exchange for the respective stocks. Although the time and sales tick API offers much more possibilities the amount of data it generates is a bit terrifying and easily begins to strangulate Excel with only a couple week's worth of records, let alone the pacing restrictions with the API, so I believe I will work with the daily API for the time being. (Not sure how far will it get me though as the first results put in doubt my original assumption that trades outside of the two largest exchanges should be statistically insignificant.)
     
    Last edited by a moderator: Apr 7, 2020
  6. raddo

    raddo

  7. I must admit that I haven't tried it myself. But I am under the impression that you are not limited to only requesting data from the primary exchange. If you use reqHistoricalData() you specify a contract for which you want the data. In this contract is a field called Exchange which you can set to the desired venue. Usually you would set this to "SMART" to get the combined data for all available venues. In your case you can replace it to the venue of interest.
    Of course you need to investigate in advance which venues are available for the contract that you want to get the data for. This you can do with reqContractDetails(). The returned data, in callback method contractDetails() has a field called validExchanges. The documentation says that this string contains all valid exchanges for the specified contract.
    I am not using IB's API with Excel so I can't comment on the limitations you are experiencing.
     
    avatar-ds likes this.
  8. Thanks for these suggestions. To clarify, I use C# for IB interaction. Excel is just for running the statistics.

    Your suggestions encouraged me to persevere and after many attempts I think I got it running. My mistake was that I also used the PrimaryExchange field for the contract and reqHistoricalData() returned back with and error claiming the venue specified in Exchange was wrong, for anything other than Exchange=="SMART" or Exchange==PrimaryExchange. PrimaryExchange seems to be harmless usually so I frequently specify it to make sure the correct stock is picked. But not with this call, it turns out. Simply throwing PrimaryExchange away when Exchange specifies an alternative venue did the trick, it appears, though I will be running more tests to make sure it is what I want indeed.
     
  9. In my applications I have no use for PrimaryExchange, so I never specify it in the contract.