Financial technical analysis in python

Question:

Do you know if there is any financial technical analysis module available for python ? Need to calculate various indicators such as RSI, EMA, DEMA etc for a project

Asked By: Finger twist

||

Answers:

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 for Yahoo! Stock Data
  • QuantLib – Open source library (supposedly has Python Bindings)
  • PyFinancial – Docs in Spanish
  • PyMacLab – “Series of classes useful for conducting research in dynamic macroeconomics”
  • TSDB – for storing large volumes of time series data
  • PyVol – volatility estimation of financial time series
Answered By: arboc7

TA-Lib – Library of indicators.
How to compile for Python

Answered By: christo

There is also a Computational Finnance Course on Coursera.org.

They use a Python Open Source Library called QSTK (QuantSoftware ToolKit).
They have a bunch of tutorials on the wiki page and you can always take the course
if you want to learn more.

For convenience I copied the description from the wiki page below:

QSToolKit (QSTK) is a Python-based open source software framework
designed to support portfolio construction and management. We are
building the QSToolKit primarily for finance students, computing
students, and quantitative analysts with programming experience. You
should not expect to use it as a desktop app trading platform.
Instead, think of it as a software infrastructure to support a
workflow of modeling, testing and trading.

Scroll through the Gallery to see the sorts of things you can do easily with QSTK.
If you are in a hurry, you can skip to the QSToolKit_Installation_Guide. 

Key components of QSTK are:

- Data: A data access package that enables fast reading of 
  historical data (qstkutil.DataAccess).
- Processing tools: Uses pandas, a Python package designed for time series 
  evaluation of equity data.
- Portfolio optimization: Using the CVXOPT library.
- Event studies: An efficient event analyzer, Event_Profiler.
- Simulation: A simple backtester, quicksim, 
  that includes transaction cost modeling.
Answered By: cwoebker

You might find this repository of technical indicators useful. The library works similarly to the famous ta-lib library, and contains indicators that were not implemented in talib

talibextensions

For example, you can use the Highest high, lowest low indicator, by sending high and low vectors, plus number of periods, in the following way: (Extracted from the test in the repository)

    from indicators import TalibExtension
    hhllMatrix = TalibExtension.HHLL(self.high, self.low, 5);
Answered By: Tom
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.