Python in Finance: Applications, Advantages, and Data-Driven Approaches, Slides of Programming Languages

python programming language for finance field

Typology: Slides

2022/2023

Uploaded on 11/07/2023

emelia-goh
emelia-goh 🇹🇭

5 documents

1 / 35

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Financial Data Analytics
C H AIWAT N.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23

Partial preview of the text

Download Python in Finance: Applications, Advantages, and Data-Driven Approaches and more Slides Programming Languages in PDF only on Docsity!

Financial Data Analytics

C H A I W A T N.

Python

  • Python is a high-level, interpreted programming language.
  • It was first released in 1991 and is now widely used for web development, data science, machine learning, and artificial intelligence.
  • Python is open source and has a large community of developers contributing to its growth and development.
  • It has a vast standard library that makes it easy to write complex programs with minimal code.
  • Python can be used on a wide range of platforms including Windows, Linux, and macOS.

Technology in Finance

  • Python's role in finance is important to consider, but first, we should reflect on the role of technology in finance.
  • Financial institutions have increasingly become technology companies due to innovation and regulation.
  • Technology is a major asset for financial institutions and can provide competitive advantages and disadvantages.
  • Understanding the background of this development can shed light on why technology is so important in finance.

Technology Spending

  • Banks and financial institutions spend the most on technology annually.
  • The overall IT spend in financial services globally will exceed $430 billion in 2014 and surpass $500 billion by 2020.
  • Large, multinational banks have thousands of developers who maintain existing systems and build new ones.
  • Large investment banks with heavy technological requirements often have technology budgets of several billion USD per year.

Technology and Talent as Barriers to Entry

  • Technology advancements can reduce costs over time.
  • Financial institutions invest heavily in technology to gain market share and defend their positions.
  • Certain areas of finance require large-scale investments in technology and skilled staff, such as the derivatives analytics space.
  • Building a complete derivatives analytics library is costly and requires experts with the right tools and technologies.
  • Today, trading, pricing, and risk management have become so complex that larger financial institutions need to deploy IT infrastructures with tens of thousands of computing cores.

Ever-Increasing Speeds, Frequencies, Data Volumes

  • Technological advances have greatly impacted the speed and frequency of financial transactions.
  • Flash trading involves trading at the highest speeds possible
  • Increasing data availability on smaller scales makes real-time reactions necessary.
  • The increasing speed and frequency of trading allows data volumes to increase, leading to processes that systematically reduce the average time scale for financial transactions.
  • Most finance theory is based on daily stock price data, while a typical trading day for Apple Inc. is quoted around 15,000 times

The Rise of Real-Time Analytics

  • Financial and data analytics is a discipline that has gained importance in the finance industry.
  • The increase in speeds, frequencies, and data volumes has led to the need for real-time analytics.
  • Financial and data analytics involves using software, technology, advanced algorithms, and methods to gather, process, and analyze data.
  • Its goal is to gain insights, make decisions, or fulfill regulatory requirements.
  • Examples include estimating sales impacts and calculating credit value adjustments for complex portfolios of derivatives trades.

The Rise of Real-Time Analytics

  • There are two major challenges that financial institutions face in this context:
  • Big data: o Banks and financial institutions have dealt with large amounts of data for a long time. o The amount of data processed during analytics tasks has increased significantly over time. o This requires increased computing power, larger memory, and storage capacities.
  • Real-time economy: o In the past, decision making was based on structured planning and management processes. o Today, decision makers must handle these functions in real-time. o Tasks that were previously handled through overnight batch runs in the back office have been moved to the front office and are executed in real-time.

Finance and Python Syntax

  • Suppose we have the following numerical parameter values for the valuation: o Initial stock index level o Strike price of the European call option o Time-to-maturity year o Constant, riskless short rate o Constant volatility
  • In the BSM model, the index level at maturity is a random variable, given by the following equation with being a standard normally distributed random variable

Finance and Python Syntax

  • The following is an algorithmic description of the Monte Carlo valuation procedure:
    1. Draw (pseudo) random numbers , from the standard normal distribution
    2. Calculate all resulting index levels at maturity for given and BSM model
    3. Calculate all inner values of the option at maturity as
    4. Estimate the option present value via the Monte Carlo estimator given by the following equation:

Finance and Python Syntax

  • Python code (cont.)

Finance and Python Syntax

  • The code can be used in interactive environments like IPython or Jupyter Notebook.
  • For reusable code, modules (or scripts) are commonly used in Python.
  • Modules are single Python files with the suffix .py.
  • The code in the module can be organized and structured differently than the interactive code.
  • Python's syntax is well-suited to complement English and mathematics in scientific programming.
  • The algorithmic example in the subsection illustrates this point.

Shorter time-to-results

  • Python is highly efficient in interactive data analytics.
  • IPython, Jupyter Notebook, and packages like pandas are powerful tools that benefit data analytics.
  • Finance students writing their thesis can use Python for analyzing historical index levels, like S&P 500, over a few years.
  • They can observe how the volatility of the index has fluctuated over time and check if volatility fluctuates over time and is not constant.
  • The results can also be visualized.

Shorter time-to-results

  • Let’s see python code which does the followings: o Retrieve index level data from the web o Calculate the annualized rolling standard deviation of the log returns (volatility) o Plot the index level data and the volatility results