The first step in gathering the data was to get a list of the S&P500. I found one an appropriate list
. After that, I needed to find an API that would work for getting real time quotes for those securities. I went with the TradeKing API which has many endpoints and can be queried for quotes at a rate of 60 per second. The full API is located
. Below is a sample of the data that I can query on a per second basis.
//A Sample Data Query
{ "response":{ "@id":"385eca86-7b6b-4c30-b9b2-02472bab7850", "elapsedtime": "0", "quotes":{"quote":{"adp_100":"21.9758","adp_200":"21.6211","adp_50":"21.3420","adv_21":"4150403","adv_30":"4328619","adv_90":"4592093","ask":"21.110","ask_time":"13:09","asksz":"23","basis":"na","beta":"1.5578","bid":"21.100","bid_time":"13:09","bidsz":"21","bidtick":"d","chg":"0.2350","chg_sign":"d","chg_t":"na","cl":"21.340","contract_size":"na","cusip":"na","date":"2016-03-15","datetime":"2016-03-15T13:09:00-04:00","days_to_expiration":"na","div":"0.1500","divexdate":"20160226","divfreq":"Q","divpaydt":"20160315","dollar_value":"30807571.625","eps":"1.0900","exch":"NYSE","exch_desc":"New York Stock Exchange","hi":"21.290","iad":"0.6000","idelta":"na","igamma":"na","imp_volatility":"na","incr_vl":"100","irho":"na","issue_desc":"na","itheta":"na","ivega":"na","last":"21.105","lo":"21.100","name":"INTERPUBLIC GROUP OF COMPANIES INC.","op_delivery":"na","op_flag":"1","op_style":"na","op_subclass":"na","openinterest":"na","opn":"21.210","opt_val":"na","pchg":"1.10","pchg_sign":"na","pcls":"21.340","pe":"19.5780","phi":"21.420","plo":"21.190","popn":"21.220","pr_adp_100":"21.9854","pr_adp_200":"21.6056","pr_adp_50":"21.3420","pr_date":"2016-03-14","pr_openinterest":"na","prbook":"4.360","prchg":"0.120","prem_mult":"na","put_call":"na","pvol":"2828648","qcond":"0","rootsymbol":"na","secclass":"0","sesn":"na","sho":"406348000","strikeprice":"na","symbol":"IPG","tcond":"54","timestamp":"1458061756","tr_num":"8261","tradetick":"e","trend":"na","under_cusip":"na","undersymbol":"na","vl":"1452523","volatility12":"0.2297","vwap":"21.209","wk52hi":"23.8000","wk52hidate":"20151230","wk52lo":"18.1600","wk52lodate":"20150901","xdate":"na","xday":"na","xmonth":"na","xyear":"na","yield":"2.8116"}}, "error": "Success" } }