Financial technical analysis in python

PythonFinance

Python Problem Overview


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

Python Solutions


Solution 1 - Python

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

Solution 2 - Python

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

Solution 3 - Python

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.

Solution 4 - Python

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);

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionFinger twistView Question on Stackoverflow
Solution 1 - Pythonarboc7View Answer on Stackoverflow
Solution 2 - PythonchristoView Answer on Stackoverflow
Solution 3 - PythoncwoebkerView Answer on Stackoverflow
Solution 4 - PythonTomView Answer on Stackoverflow