Relative Strength Index in python pandas

It is important to note that there are various ways of defining the RSI. It is commonly defined in at least two ways: using a simple moving average (SMA) as above, or using an exponential moving average (EMA). Here’s a code snippet that calculates various definitions of RSI and plots them for comparison. I’m discarding … Read more

Download history stock prices automatically from yahoo finance in python

When you’re going to work with such time series in Python, pandas is indispensable. And here’s the good news: it comes with a historical data downloader for Yahoo: pandas.io.data.DataReader. from pandas.io.data import DataReader from datetime import datetime ibm = DataReader(‘IBM’, ‘yahoo’, datetime(2000, 1, 1), datetime(2012, 1, 1)) print(ibm[‘Adj Close’]) Here’s an example from the pandas … Read more

Download all stock symbol list of a market [closed]

Exchanges will usually publish an up-to-date list of securities on their web pages. For example, these pages offer CSV downloads: http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NASDAQ&render=download http://www.nasdaq.com/screening/companies-by-industry.aspx?exchange=NYSE&render=download http://www.asx.com.au/asx/research/ASXListedCompanies.csv NASDAQ Updated their site, so you will have to modify the URLS: NASDAQ https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nasdaq&render=download AMEX https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=amex&render=download NYSE https://old.nasdaq.com/screening/companies-by-name.aspx?letter=0&exchange=nyse&render=download Depending on your requirement, you could create the map of these URLs by exchange … Read more

Decimal vs Double Speed

Floating point arithmetic will almost always be significantly faster because it is supported directly by the hardware. So far almost no widely used hardware supports decimal arithmetic (although this is changing, see comments). Financial applications should always use decimal numbers, the number of horror stories stemming from using floating point in financial applications is endless, … Read more

Which are the order matching algorithms most commonly used by electronic financial exchanges?

In general, there are two groups of matching algorithms, one for each of the states of the market: Continuous trading Auction There’s quite a variety of algorithms for auction trading, which is used before the market opens, on market close etc. but most of the time, the markets do continuous trading. I’ll therefore go into … Read more

High Frequency Trading [closed]

To expand on what Paul said: The server executing HFT or UHFT are almost always collocated in the exchange’s data center. This minimizes latency and also allows the algos use Flash orders (which might be banned soon) to get first look at order flow before the order is broadcast into the market. many algo’s will … Read more

Financial technical analysis in python [closed]

Here are a few thoughts… I have only used Numpy, Scipy, and Matplotlib for financial calculations. py-fi – very basic financial functions fin2py – financial tools Numpy/Scipy – covers all of the statistics basics Matplotlib – plotting financial functions RPy – a Python interface to R allowing use of R libraries ystockquote – Python API … Read more

Best/Most Comprehensive API for Stocks/Financial Data [closed]

Yahoo’s api provides a CSV dump: Example: http://finance.yahoo.com/d/quotes.csv?s=msft&f=price I’m not sure if it is documented or not, but this code sample should showcase all of the features (namely the stat types [parameter f in the query string]. I’m sure you can find documentation (official or not) if you search for it. http://www.goldb.org/ystockquote.html Edit I found … Read more