does anybody know a site where I can download historical data on stocks including companies that have gone bankrupt such as lehman brothers?
it appears that bankrupt companies no longer appear in the finance sites that I know...
Google and Yahoo finance have a survivorship bias -- they only include firms that are still around. I know of no free source that provides the data you seek. I get my data from Compustat and CRSP via the Wharton Resource Data Service, but these (or Bloomberg or Reuters) are likely too expensive for an individual.
Have you asked your broker if they will sell you the data you want?
There is a very cheap, i.e. free, way of obtaining the list of companies included in the S&P 500 at any given time.
Check the revision history for the S&P 500 List updates on Wikipedia.
It is ugly and unreliable but you usually get what you pay for :) ... it should be okay if you are just playing around with your own strategies.
This doesn't solve the main issue since you still need a way to get the data for those companies. But having the right ticker usually helps...
Take a look at http://www.mergent.com/servius - I believe they have historical data for all companies, whether they're currently being traded or not.
(Disclosure: The API is managed by my company)