Algorithmic Trading Strategies and Execution

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Yi Peng is celebrated in Thailand.

True (A)

Lotus shaped baskets are released onto rivers during Yi Peng.

False (B)

Kabuki is a form of traditional Japanese drama.

True (A)

Only female actors perform Kabuki.

<p>False (B)</p> Signup and view all the answers

The Kodo Taiko drumming troupe is based in Tokyo.

<p>False (B)</p> Signup and view all the answers

The name 'Kodo' conveys the meaning 'Heartbeat'.

<p>True (A)</p> Signup and view all the answers

The Sapporo Snow Festival takes place in February.

<p>True (A)</p> Signup and view all the answers

The Sapporo Snow Festival features sand sculptures.

<p>False (B)</p> Signup and view all the answers

Nang Yai puppets are made of plastic.

<p>False (B)</p> Signup and view all the answers

Nang Yai features shadow puppets.

<p>True (A)</p> Signup and view all the answers

Flashcards

Nang Yai

A form of large shadow puppet play in Thailand, made of painted buffalo hide, narrated by songs, chants, and music.

Songkran Festival

A festival celebrating the Thai New Year, characterized by large water fights.

Yi Peng Festival

A sky lantern festival celebrated in Northern Thailand (especially Chiang Mai). The lighted lanterns are released into the sky.

Sapporo Snow Festival

Also known as Yuki-matsuri, a festival held annually in Sapporo, Japan, featuring ice and snow sculptures.

Signup and view all the flashcards

Kodo Taiko

Japanese drumming festival and professional taiko drumming troupe based in Sado Island, Japan.

Signup and view all the flashcards

Kabuki Theater

A traditional Japanese drama with highly stylized song, mime, and dance now performed only by male actors.

Signup and view all the flashcards

Loy Krathong

A floating lantern festival celebrated nationwide in Thailand by releasing lotus-shaped baskets decorated with candles and flowers onto the rivers and waterways.

Signup and view all the flashcards

Study Notes

Algorithmic Trading

  • Utilizes computer programs to automate trading processes.
  • Aims to execute orders at the best possible price.
  • Strategies include directional bets, market making, arbitrage, statistical arbitrage, index fund rebalancing, pairs trading, and execution algorithms.

Types of Trading

  • Directional: Betting on the price direction of a stock.
  • Market Making: Providing bid/ask quotes to profit from the spread.
  • Arbitrage: Exploiting price differences of an asset in different markets.
  • Statistical Arbitrage: Employing algorithms to identify statistical mispricing and using mean reversion strategies.
  • Index Fund Rebalancing: Trading activities resulting from fund rebalancing.
  • Pairs Trading/Correlation Trading: Betting on the convergence of correlated stocks when they deviate.
  • Execution Algorithm: Using algorithms like VWAP, TWAP, POV, and IS to execute large orders.

Execution Algorithm

  • Aims to execute large orders while minimizing market impact.
  • Volume Weighted Average Price (VWAP): Executes orders based on historical volume patterns.
  • Time Weighted Average Price (TWAP): Distributes the order execution evenly over a specified time.
  • Percent of Volume (POV): Participates with a predetermined percentage of the market volume.
  • Implementation Shortfall (IS): Designed to minimize costs and slippage.

Order Book

  • A limit order book (LOB) is an electronic record of outstanding limit orders.

Order Book Events

  • Limit Order: Order to buy/sell at a specific price, adding liquidity to the order book.
  • Market Order: Order to buy/sell immediately at the best available price, removing liquidity.
  • Cancel Order: Removal of a pre-existing limit order from the order book.

Order Book Example

  • At a price of $100.01, there's a buy and sell size of 100 shares each.
  • At a price of $100.00, there's a buy and sell size of 200 shares each.
  • At a price of $99.99, there's a buy and sell size of 300 shares each.
  • At a price of $99.98, there's a buy and sell size of 400 shares each.
  • At a price of $99.97, there's a buy and sell size of 500 shares each.

Market Order: Buy 100 Shares

  • Requires purchasing 100 shares at $100.01
  • Results in a new best offer at $100.00

Market Order: Sell 300 Shares

  • Requires selling 100 shares at $99.99
  • Selling an additional 200 shares at $99.98.
  • Results in the new best bid at $99.97.

Order Book Statistics

  • Important statistics include best bid/ask, mid price, spread, book depth, order flow, and order size.
  • Mid Price is the average of Best Bid and Best Ask
  • Spread is the difference between Best Ask and Best Bid

Simple Trading Strategies

  • Mean Reversion: A strategy that assumes prices will revert to their average value; short when z > threshold, long when z < threshold.
  • Pairs Trading: Capitalizes on temporary divergence between correlated stocks; short the "expensive" stock and long the "cheap" stock.
  • Delta One: Involves buying shares of a company before its S&P500 inclusion to profit from the anticipated price increase.
  • Market Making: Quoting tight bid-ask spreads to repeatedly earn small profits.
  • Arbitrage: Taking advantage of price discrepancies in different markets.

Basic Time Series Analysis

  • Key components include trend, seasonality, cycle, and irregularity.
  • Apply descriptive statistics and hypothesis testing to identify patterns, correlation, stationarity and volatility

Common Trading Signals

  • Signals include Moving Averages, Bollinger Bands, MACD, RSI, Stochastic Oscillator, Ichimoku Cloud, and Fibonacci Retracement.

Back Testing

  • Considers factors like Transaction Cost and Slippage.

Backtesting Metrics

  • Total Return: Overall profit or loss over the backtesting period.
  • Annualized Return: Average annual return of the strategy.
  • Sharpe Ratio: Measures risk-adjusted return, calculated as $\frac{R_p - R_f}{\sigma_p}$.
  • Sortino Ratio: Measures downside risk-adjusted return, calculated as $\frac{R_p - R_f}{\sigma_d}$.
  • Maximum Drawdown: The largest peak-to-trough decline during a specific period. Calculated as $Drawdown = \frac{Current,Value - Peak,Value}{Peak,Value}$
  • Win Rate: Percentage of profitable trades.
  • Profit Factor: Ratio of Gross Profit to Gross Loss.

Overfitting

  • Model performs well on training data but poorly on test data.
  • Due to excessive complexity which captures noise
  • Can be avoided by: keeping it simple, using cross-validation, regularization, and more data
  • Use out-of-sample testing

Máquina de Aprendizaje Algoritmos

Clasificación

  • Assigns an instance to a finite number of classes using training data consisting of labeled instances.
  • Types: Logistic Regression, SVM, Decision Trees, Random Forests, Neural Networks

Regresión

  • Predicts a continuous value using a training dataset of instances labeled with continuous values.
  • Types: Linear Regression, Polynomial Regression, SVM, Decision Trees, Random Forests, Neural Networks

Agrupamiento

  • The algorithm groups similar instances from a training dataset each unaassociated with a class label
  • Types: K-Means, Hierarchical Clustering, DBSCAN, Spectral Clustering, GMM

Reducción de la dimensionalidad

  • Reduces the number of features while preserving important aspects.
  • Types: PCA, LDA, Autoencoders, t-SNE, Feature selection

Introduction to Algorithmic Trading

Algorithmic Trading

  • Computer programs are employed to automate trading also known as automated trading or black-box trading.

Order Execution

  • Objective is to get orders filled at the best possible price.

High-Frequency Trading (HFT)

  • Characterized by its high speeds, high turnover rates, and high order-to-trade ratios and depends on co-location, DMA, complex algorithms
  • DMA stands for direct market access

Advantages of Algorithmic Trading

  • Reduced Transactions Cost
  • Improved order execution
  • Increased market efficiency
  • Automation
  • Backtesting

Disadvantages of Algorithmic Trading

  • Model Risk: Possibility of algorithm based on a flawed model.
  • Technical Risk: Possibility of technical problems ex. software bugs
  • Market Risk: Flash crash
  • Regulatory Risk: Possibility of change in regulation
  • Increased Competition

Types of Algorithmic Trading Strategies

  • Statistical Arbitrage is exploiting statistical relationships between different assets
  • Market Making provides liquidity to the market by placing buy and sell orders
  • Trend Following identifies and follows trends in the market
  • Execution Algorithms optimize the execution of orders

Order Book

  • A limit order book (LOB) is an electronic list of buy and sell orders for a specific security or financial instrument in order of price level

Components of an Order Book

  • Bid: Buyer's highest price for a share
  • Ask (Offer): Seller's lowest price for a share
  • Bid Size: Shares buyers will buy for bid price
  • Ask Size: Shares the sellers will sell for an ask price
  • The mid-price is the middle between the bid and ask prices. The mid-price formula is $\text{Mid-Price} = \frac{\text{Bid} + \text{Ask}}{2}$

An example of an order book for a hypothetical stock

  • At a price of $100.00 the size of the bid is 100 via order type being bid
  • At a price of $99.99 the size of the bid is 50 via order type being bid
  • At a price of $99.98 the size of the bid is 25 via order type being bid
  • At a price of $100.01 the size of the ask is 30
  • At a price of $100.02 the size of the ask is 75
  • At a price of $100.03 the size of the ask is 100
  • Shares the sellers will sell for an ask price

Dynamics of Order Book

  • Order Placement: Traders place order
  • Order Cancellation: Traders can cancel their existing orders
  • Order Matching: Trading happens when buy orders match sell orders
  • Price Discovery: Price discovery is finding out the correct price

The definition and description of further Order Book jargon

  • Market Impact: Affected because change in price affected by trading
  • Slippage: Not the intended result

Thermodynamics

  • Study of energy, its transformations, and its relation to matter.

Basic Concepts

  • A System is part of the universe under study
  • The Surroundings are everything outside of the system
  • The Boundary Separates system from surroundings.

Types of Systems

  • An Isolated System does not exchange matter or energy
  • A Closed System exchanges energy but not matter
  • An Open System exchanges both energy and matter

Thermodynamic Properties

  • Intensive Properties: Temperature, Pressure, Density
  • Extensive Properties: Volume, Mass, Energy

Intensive Properties

  • Are independent of the amount of substance ex. Temperature, Pressure and Density

Extensive Properties

  • Are dependent on the amount of substance ex. Volume, Mass and Energy

Thermodynamic Process Types

  • Isothermal: Constant temperature.
  • Adiabatic: No heat exchange.
  • Isobaric: Constant pressure.
  • Isochoric: Constant volume.

Process Types Based on Equilibrium

  • Reversible System is in equilibrium, is infinitesimally slow.
  • Irreversible Occurs spontaneously, is not in equilibrium.

Laws of Thermodynamics

  • Zeroth Law States: If two systems are each in thermal equilibrium, they are in thermal equilibrium with each other.
  • First Law States: Energy cannot be created or destroyed, only transformed. With $\Delta U = Q - W$
  • Second Law States: The entropy of an isolated system always increases or remains constant. $\Delta S \geq 0$
  • Third Law States: The entropy of a perfect crystal at absolute zero temperature is zero.

Thermodynamic Functions

  • Enthalpy: H = U + PV U is internal energy, P is pressure, and V is volume
  • Entropy: Measure of randomness

Gibbs Free Energy

  • G = H - TS where T is Temperature

Thermodynamic Applications

  • Heat Engines: Convert energy to work
  • Refrigerators: Transfer heat
  • Chemical Reactions: Predict equilibrium

Fourier Transform Properties

Linearity

  • The Fourier transform is a linear combination defined as: $F{af(t) + bg(t)} = aF(f(t)) + bF(g(t))$

Time Scaling

$F{f(at)} = \frac{1}{|a|}F(\frac{\omega}{a})$

  • Proof:*

$F{f(at)} = \int_{-\infty}^{\infty} f(at)e^{-j\omega t} dt$

Let $\tau = at$, $dt = \frac{1}{a}d\tau$

$F{f(at)} = \int_{-\infty}^{\infty} f(\tau)e^{-j\omega \frac{\tau}{a}} \frac{1}{a} d\tau = \frac{1}{a} \int_{-\infty}^{\infty} f(\tau) e^{-j\frac{\omega}{a} \tau} d\tau$

$F{f(at)} = \frac{1}{a}F(\frac{\omega}{a})$ if a > 0

$F{f(at)} = \frac{1}{|a|}F(\frac{\omega}{a})$

Other Identities

$F{f(t - t_0)} = e^{-j\omega t_0}F(\omega)$ $F{e^{j\omega_0 t}f(t)} = F(\omega - \omega_0)$ $F{\frac{df(t)}{dt}} = j\omega F(\omega)$ $F{\frac{d^n f(t)}{dt^n}} = (j\omega)^n F(\omega)$ $F{tf(t)} = j\frac{dF(\omega)}{d\omega}$ $F{t^n f(t)} = j^n \frac{d^n F(\omega)}{d\omega^n}$ $F{\int_{-\infty}^{t} f(\tau) d\tau} = \frac{1}{j\omega}F(\omega) + \pi F(0)\delta(\omega)$ $F{f(t) * g(t)} = F(\omega)G(\omega)$ $F{f(t)g(t)} = \frac{1}{2\pi}F(\omega) * G(\omega)$

More identities

  • Duality If $f(t) \leftrightarrow F(\omega)$, then $F(t) \leftrightarrow 2\pi f(-\omega)$
  • Parseval's Theorem: $\int_{-\infty}^{\infty} |f(t)|^2 dt = \frac{1}{2\pi} \int_{-\infty}^{\infty} |F(\omega)|^2 d\omega$

Organic Chemistry

Alkanes

Nomenclature Rules

  • Localizar la cadena continua más larga de átomos de carbono;
  • Numerar la cadena principal comenzando por el extremo más cercano.Localizar la cadena continua más larga de átomos de carbono.

Naming Example

  • Prefix "met" if 1 carbon
  • Prefix "et" if 2 carbon
  • Prefix "prop" if 3 carbon
  • Prefix "but" if 4 carbon
  • Prefix "pent" if 5 carbon
  • Prefix "hex" if 6 carbon
  • Prefix "hept" if 7 carbon
  • Prefix "oct" if 8 carbon
  • Prefix "non" if 9 carbon
  • Prefix "dec" if 10 carbon

Organic Chemistry Group

Alkyl Group

  • Has 1 Alkane removed
  • Methyl (CH3)
  • Ethyl (CH2CH3)
  • Propyl (CH2CH2CH3)
  • Isopropyl

Alkyl Halides

  • An alkyl halide contains a halogen attached to sp3 ex

Halogenuros de alquilo

  • Chloride(CH3Cl)
  • Bromide(CH3CH2Br)

Alcohols contains Hydroxyl(OH)

  • Metanol
  • Ethanol

Ethers Contains (O)

  • Dimethyl ether
  • Diethyl ether

Amines Contains Nitrogen(N)

  • Methylamine
  • Dimethylamine
  • Trimethylamine

Aldehydes Conatin Carbonyl

  • Aldehyde has hydrogen attached to carbonly carbon

Ketones Contains Carbonly

  • Has 2 carbon connected to the carbons in carbonyl

Caboxylic Acids Has Caronyl(C=O)w/ Hydroxyl Group(OH)

Esters Has C=O Attached w/ oxygen attached

Chapter 5: The Nucleus of the Cell

Genetic info exists inside of the Nucleus

  • The Nucleus is the largest organelle in eukaryotic cells
  • It has all the cell's DNA composed in the form of chromosomes
  • The Nucleus is involved in gene expression and cell activities

Nuclear Structure and Function

  • Is composed of the nuclear envelope which is a double membrane
  • Contains nuclear powers that control molecules between the nucleus and cytoplasm
  • The Nucleolus is involved in production of protiens
  • Composed of DNA and protein which compose the nucleus

Chromosomes

  • Has chromatin
  • Each chromosome is composed of DNA
  • The Chromosomes become condensed which allows them to become visible with machines

Chromatin Structure

  • DNA is wrapped around nucleosomes.
  • Nucleosomes form higher-order configurations
  • Chromatin compaction changes based on the cell cycle and the level of expression

Nuclear Envelope

  • Is a double membrane that surrounds the nucleus
  • Is composed of an inner and outer membrane with a perinucleal region
  • Contains Nuclear powers that modulate molecules from the outside and inside

Nuclear Powers

  • Are complexes
  • Modulate transfer of molecules

Nucleolus

  • Is involved in protiens using ribosomal RNA also knows as rRNA

Nuclear Matrix

  • Has protein fibres throughout and functions by -Providing structural support -Organizing chromatin

Replication and repair

Polymerase

  • Synthesizes DNA

Ligase

  • Joins Fragments

Origin of replication

DNA repair

  • corrects DNA damage

Types of DNA Repair

  • Mismatch repair
  • Nucleotide excision repair
  • Base excision repair

The Cell Cycle Overview

  • The cell cycle is essential for growth, development, and repair in multicellular organisms.
  • In unicellular organisms, the cell cycle is essential for reproduction

Cell Death

  • Cell cycle is divided to interphase and m phase

Necrosis

  • Cell Death caused by injury

Apoptosis

  • Cell Death which is part of devolopment

Interphase

  • Preparation for dividing, gathering nutrient $G_1$: Growth and Function S: DNA copies $G_2$: Further growth and prep

M Phase

  • Division consists mitosis and cytokinesis

Mitosis:

  • Nuclear division has stages such as -Prophase -Prometaphase -Metaphase -Anaphase -Telophase

Key Regulators:

  1. Cyclins: proteins that fluctuate in concentration cyclically.
  2. Cyclin-Dependent Kinases (CDKs): Enzymes

Cell Cycle Checkpoints

    1. $G_1$ Checkpoint is at DNA damage
  1. $G_2$ Checkpoint is for problems via for complete replication
  2. M checkpoint is an error preventer in mitosis

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

More Like This

Algorithmic Trading Concepts
10 questions

Algorithmic Trading Concepts

ProvenLongBeach4765 avatar
ProvenLongBeach4765
Algorithmic Trading
10 questions

Algorithmic Trading

ModernGyrolite1514 avatar
ModernGyrolite1514
Algorithmic Trading
10 questions

Algorithmic Trading

JoyousHoneysuckle9102 avatar
JoyousHoneysuckle9102
Use Quizgecko on...
Browser
Browser