I would like to build a couple of custom indices. I would like to be able to enter ticker(s) into an input and have ohlc, volume, qualitative ...data downloaded from yahoofinance, google finance, finviz etc over x period. From this I would like to build a geometric average indices for high momentum stocks and value stocks. I would then like to conduct analysis of these indices as they relate to each other. What stocks have highest/lowest correlation over x period, volume/range analysis, momentum over x period, sma for pairs trade....Is this a job for python or R? Do you have any suggestions on what packages/resources I would need to do this kind of analysis? I appreciate your help.
Both R and Python can do this very nicely.
For Python you would need the
pandas package and its dependencies.
pandas has a lot of basic statistics, but for more advanced statistics like it looks like you want to do, you can use the
statsmodels package, which can work directly with
pandas data types. It can also download the
csv files directly off the website if given a url, even from
https sites. Further, it can download the sort of stock data you want for you, just by giving it a stock ticker and a date range. You can download a python distribution like anaconda or python(X,Y) which will have
statsmodels built-in, so no additional installation is necessary.
R doesn't need any additional packages. It can do roughly the same things as
statsmodels for your purposes. It can also download
csv files off the web if given a url, but apparently chokes on https files (which
pandas doesn't), although you may not even be downloading any files through these programs. You can use another tool to do this in R, though, and it will likely only add an additional line or two of code. With additional packages, such as
Quandl, it can also download stock data using a ticker and date range.