Python For Finance
  • Home
  • Resources
  • Home
  • Resources
Python For Finance

Python, finance and getting them to play nicely together...

    Basic Data Analysis

    Seaborn Module and Python – Distribution Plots

    by s666 22 July 2018

    I thought for this post I would look into the Seaborn library – Seaborn is a statistical plotting library and is built on top of Matplotlib. It has really nice looking default plotting styles and also works really well with Pandas DataFrames – so we can leverage the work we have done with Pandas in previous blog posts and hopefully create some great plots.

    Seaborn can be installed just like any other Python package by using “pip”. Go to your command line and run:

    pip install seaborn

    The official documentation page for Seaborn can be found here and a lovely looking gallery page showing examples of what is possible with Seabon can be found here. You can click on any of the images on the gallery page and it will present you with example code on how to produce that particular plot. Another important page is the API page, which references the various available plot types – this can be found here.

    I am going to try to break the Seaborn capabilities down into various categories – and begin with the plots that allow us to visualise the distribition of a data set

    Continue Reading
    22 July 2018 2 comments
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Basic Data AnalysisBeginners Resources

    Native Excel Functionality with Python and openpyxl Module

    by s666 9 July 2018
    by s666 9 July 2018

    In this article I shall be looking into using the Python module “openpyxl” to manipulate data within the Python ecosystem, while also being able to tap into excel functionality directly. I believe Python is a much better ecosystem within which to do any kind of data munging/analysis, however Excel is a much used platform, favoured by many as the means…

    Read more
    1 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Trading Strategy Backtest

    Mean Reversion Pairs Trading With Inclusion of a Kalman Filter

    by s666 4 July 2018
    by s666 4 July 2018

    In this article we are going to revisit the concept of building a trading strategy backtest based on mean reverting, co-integrated pairs of stocks. So to restate the theory, stocks that are statistically co-integrated move in a way that means when their prices start to diverge by a certain amount (i.e. the spread between the 2 stocks prices increases), we…

    Read more
    2 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Basic Data Analysis

    Replicating Excel Functionality in Pandas

    by s666 30 June 2018
    by s666 30 June 2018

    This article is aimed at showing how to replicate some common Excel tasks using Python and the Pandas library. The point and click interface of Excel means the learning curve is somewhat lesssteep than it is for using Pandas – however once a certain level of proficiency is met when using Pandas, the possibilities presented are far greater than you…

    Read more
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Basic Data Analysis

    Trading Strategy Analysis using Python and the FFN Package – Part 2

    by s666 15 March 2018
    by s666 15 March 2018

    Hi all, this is the second part to the “Trading Strategy Analysis using Python and the FFN Package” post (the first part can be found here). Last time we went over the use of the “PerformanceStats” object in ffn, whereas this time I want to concentrate on the “GroupStats” object. The former is for use with single series of data,…

    Read more
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Basic Data Analysis

    Trading Strategy Analysis using Python and the FFN Package – Part 1

    by s666 27 February 2018
    by s666 27 February 2018

    In this post I will be reviewing and running through examples of using the brilliant python module, “ffn – Financial Functions for Python“, which has been created by Philippe Morissette and released on the MIT license. The github page can be found here (http://pmorissette.github.io/ffn/index.html) The module helps quickly carry out analysis of trading strategies and financial asset price series/history. It…

    Read more
    1 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Basic Data Analysis

    Stock Clusters Using K-Means Algorithm in Python

    by s666 8 February 2018
    by s666 8 February 2018

    For this post, I will be creating a script to download pricing data for the S&P 500 stocks, calculate their historic returns and volatility and then proceed to use the K-Means clustering algorithm to divide the stocks into distinct groups based upon said returns and volatilities. So why would we want to do this you ask? Well dividing stocks into groups…

    Read more
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Uncategorized

    Stock Return Heatmap using Seaborn

    by s666 7 February 2018
    by s666 7 February 2018

    Hi all, this post is going to be a relatively short and to the point run through of creating an annotated heatmap for the Dow 30 stock returns using the Python Seaborn package. Let’s start with what is a heatmap actually is; it’s defined as “a representation of data in the form of a map or diagram in which data…

    Read more
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Trading Strategy Backtest

    Stochastic Oscillator Trading Strategy Backtest in Python

    by s666 10 October 2017
    by s666 10 October 2017

    I thought for this post I would just continue on with the theme of testing trading strategies based on signals from some of the classic “technical indicators” that many traders incorporate into their decision making; the last post dealt with Bollinger Bands and for this one I thought I’d go for a Stochastic Oscillator Trading Strategy Backtest in Python. Let’s…

    Read more
    1 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • Trading Strategy Backtest

    Bollinger Band Trading Strategy Backtest in Python

    by s666 31 July 2017
    by s666 31 July 2017

    So, after a long time without posting (been super busy), I thought I’d write a quick Bollinger Band Trading Strategy Backtest in Python and then run some optimisations and analysis much like we have done in the past. It’s pretty easy and can be written in just a few lines of code, which is why I love Python so much…

    Read more
    0 FacebookTwitterPinterestLinkedinRedditWhatsappTelegramEmail
  • 1
  • 2
  • 3
  • 4
  • 5

Categories

  • Basic Data Analysis (20)
  • Beginners Resources (9)
  • Data Analysis (3)
  • Data Wrangling (1)
  • Portfolio Optimisation (1)
  • Trading Strategy Backtest (24)
  • Uncategorized (2)

About Me

About Me

I am a current PhD Computer Science candidate, a CFA Charterholder (CFAI) and Certified Financial Risk Manager (GARP) with over 16 years experience as a financial derivatives trader in London. I also hold an MSc in Data Science and a BA in Economics. Finance / Machine Learning / Data Visualization / Data Science Consultant I am mostly interested in projects related to data science, data visualization, data engineering and machine learning, especially those related to finance.

Hire Me on People Per Hour

Python Blogs

Archives

  • November 2020 (1)
  • October 2020 (1)
  • October 2019 (2)
  • July 2019 (3)
  • June 2019 (2)
  • May 2019 (1)
  • April 2019 (2)
  • February 2019 (1)
  • January 2019 (5)
  • December 2018 (1)
  • September 2018 (1)
  • July 2018 (3)
  • June 2018 (1)
  • March 2018 (1)
  • February 2018 (3)
  • October 2017 (1)
  • July 2017 (1)
  • February 2017 (2)
  • January 2017 (2)
  • December 2016 (1)
  • November 2016 (1)
  • September 2016 (2)
  • July 2016 (2)
  • May 2016 (1)
  • April 2016 (4)
  • March 2016 (4)
  • Facebook
  • Twitter
  • Linkedin
  • Github
  • Stack-Overflow
  • Reddit
Footer Logo

@2019 - All Rights Reserved PythonForFinance.net

SiteLock


Back To Top