Skip to main content
 

FINN43815: Python for Finance

It is possible that changes to modules or programmes might need to be made during the academic year, in response to the impact of Covid-19 and/or any further changes in public health advice.

Type Tied
Level 4
Credits 15
Availability Available in 2024/2025
Module Cap None.
Location Durham
Department Finance

Prerequisites

  • None

Corequisites

  • None

Excluded Combinations of Modules

  • None

Aims

  • To develop an understanding of the general principles and specific techniques of programming in Python;
  • To grasp the capabilities of Python for applications in finance, including portfolio management, algorithmic trading, risk management and asset pricing;
  • To develop an ability to use Python packages for financial data analysis and solving problems in the above-mentioned fields in finance.

Content

  • This module aims to introduce the students to programming in Python and to explore its applications in finance. The module covers both the practical aspects of Python applications as well as the financial theory behind those applications. Prior programming experience is helpful but not required. The module starts with foundations of Python programming for finance including:
  • installation of Python (Anaconda and Jupyter notebook);
  • grammar, variable types, conditional statements, functions and loops;
  • importing data (from local directory);
  • data extraction from the web (with scrapy);
  • data manipulation (with pandas);
  • data visualisation (with plotly);
  • Having equipped ourselves with the fundamentals of Python we will then move to the following topics and applications in finance:
  • regression analysis (CAPM, Fama & French 1993, Fama & MacBeth 1973);
  • algorithmic trading including constructing and backtesting various trading strategies (the long-short and pairs trading);
  • portfolio performance analytics (risk-return profile, maximum drawdown, value at risk, expected shortfall);
  • Option pricing (with Black-Scholes and Monte Carlo simulation);
  • Intorduction to financial machine learning;
  • sentiment analysis with text mining.

Learning Outcomes

Subject-specific Knowledge:

  • general principles and techniques of programming in Python;
  • wide range of applications and capabilities of Python for solving various problems in finance;
  • financial theory behind those applications;
  • key econometric and machine learning techniques.

Subject-specific Skills:

  • using Python to import, manipulate, visualise and analyse financial data;
  • gaining hands-on experience of using Python packages for statistical analysis, back-testing trading strategies, machine learning, Monte Carlo simulation, and textual analysis;
  • handling large (structured and unstructured) datasets and using them in conjunction with the appropriate empirical techniques to solve various problems in finance and interpret the obtained results.

Key Skills:

  • programming and computer literacy skills (through using Python in tutorials and for the project);
  • interpersonal and written communication skills (through working in a team on the written project);
  • problem solving and analytical skills (through using Python to solve problems and interpreting results);
  • planning, organising and time management skills (through meeting the multiple deadlines for formative and summative assignments of the module).

Modes of Teaching, Learning and Assessment and how these contribute to the learning outcomes of the module

  • The module is highly practical in nature and is delivered through a combination of lectures and practical sessions. The coding component will be taught using web-based Jupyter notebooks (you are welcome to use Spyder as well). There is an online component (DataCamp self-study courses) to be completed prior to the commencement of the module. The students are assessed through the summative and formative assignments.
  • The summative assignment consists of: (1) a written group project (trading stratergy back-testing and performance analysis) and (2) an online examination to test knowledge and critical understanding of the covered material. The formative assignment consists of short online quizzes including multiple choice and code-based questions.

Teaching Methods and Learning Hours

ActivityNumberFrequencyDurationTotalMonitored
Lectures101 per week1 hour10Yes
Practical Sessions71 per week in teaching weeks 3 to 92 hours14Yes
DataCamp Courses (self-study)44 hours16 
Preparation and Reading110 
Total150 

Summative Assessment

Component: ProjectComponent Weighting: 40%
ElementLength / DurationElement WeightingResit Opportunity
Written Group Project2500 words (max)100same
Component: ExaminationComponent Weighting: 60%
ElementLength / DurationElement WeightingResit Opportunity
Online synchronous timed written exam2 hours100same

Formative Assessment

Online quizzes

More information

If you have a question about Durham's modular degree programmes, please visit our Help page. If you have a question about modular programmes that is not covered by the Help page, or a query about the on-line Postgraduate Module Handbook, please contact us.

Prospective Students: If you have a query about a specific module or degree programme, please Ask Us.

Current Students: Please contact your department.