Algorithms Used By Financial Institutions

Enhanced DMA strategies

  • Iceberging: Large order is partially hidden. Max shares shown used as input.
  • Pegging: Order is sent with dynamic price that changes according to market conditions.
  • Smart order routing: Liquidity is aggregated from several sources. Orders are matched to the best price and liquidity.
  • Simple time slicing: Order is split and market orders are sent at regular time intervals.
  • MOC: Order is sent into the closing auction.
Quantitative algorithms
  • VWAP: Uses standard VWAP as a benchmark and attempts to distribute large volume at the best price adjusting for volume traded in the period.
  • TWAP: Similar to VWAP but uses time instead of volume.
  • Participate [Inline, Follow, With Volume, POV]: Trades volume using a fraction as input.
  • MOC: Enhanced MOC with optimized risk and impact.
  • Implementation Shortfall (Execution Shortfall, Arrival Price): Manages the trade off between impact and risk to execute trades as close as possible to a target midpoint .
– A buy-side handbook Algorithmic Trading
Advertisements

Financial Models

The aim of financial models

  • Models are used to rank securities by value
  • Models are used to interpolate from liquid prices to illiquid ones
  • Models transform intuitive linear quantities into nonlinear dollar values

The right way to use models

  • Avoid too much axiomatization
  • Good models are vulgar in a sophisticated way
  • Start with a model and overlay it with common sense and experience
  • Know what’s assumed and what has been removed
  • Think of models as Gedanken Experiments
  • Beware of idolatry
It takes intuition to discover theories. Intuition may sound casual but it results from intimate knowledge acquired by careful observation and painstaking effort.
When you struggle with a field of inquiry for a long time and you eventually master and incorporate not only its formalism but its content,, you can make use of it to build things one level higher.
Intuition is a merging of the understander with the understood. It is the deepest kind of knowledge.
– Excerpt taken from “Metaphors, Models & Theories” by Emanuel Derman

Pairs: Pair Arrows Double

input Mean_Dist_Pos = .7;
input Mean_Dist_Neg = -.7;
input SMA_len = 10;
input R = 40;

def price = ((open(getSymbolPart(1)) + close(getSymbolPart(1))) / 2) - ((open(getSymbolPart(2)) + close(getSymbolPart(2))) / 2);
def SMAOC = Average(price, SMA_len);
def DistFromSMAOCave = price - SMAOC;

plot ArrowDn = Mean_Dist_Pos < DistFromSMAOCave and correlation(close(getSymbolPart(1)), close(getSymbolPart(2)),R) > Mean_Dist_Pos;

plot ArrowUp = Mean_Dist_Neg > DistFromSMAOCave and correlation(close(getSymbolPart(1)), close(getSymbolPart(2)),R) > Mean_Dist_Pos;

#  and correlation(((open(getSymbolPart(1)) + close(getSymbolPart(1))) / 2) , ((open(getSymbolPart(2)) + close(getSymbolPart(2))) / 2)) > Mean_Dist_Pos;

ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Pairs: Distance From Mean OCave

declare lower;
input Mean_Dist_Pos = .7;
input Mean_Dist_Neg = -.7;
input SMA_len = 10;
input Std_Dev_Len = 20;

def Length = 1;
def price = ((Open(getSymbolPart(1))+Close(getSymbolPart(1)))/2)-((Open(getSymbolPart(2))+Close(getSymbolPart(2)))/2);
def SMAOC = Average(price, SMA_len);

plot DistFromSMAOCave = price - SMAOC;
DistFromSMAOCave.SetDefaultColor(GetColor(6));

plot sigma = stdev(price, Std_Dev_Len);
sigma.SetDefaultColor(GetColor(8));

Plot zeroline = 0;
ZeroLine.SetDefaultColor(GetColor(1));

Pairs: Distance From Mean OCave Single Ticker

declare lower;
input Pair = "AU";
input SMA_len = 10;
input Std_Dev_Len = 20;

def Length = 1;
def price = ((Open+Close)/2)-((Open(Pair)+Close(Pair))/2);
def SMAOC = Average(price, SMA_len);

plot DistFromSMAOCave = price - SMAOC;
DistFromSMAOCave.SetDefaultColor(GetColor(6));

plot sigma = stdev(price, Std_Dev_Len);
sigma.SetDefaultColor(GetColor(8));

plot zscore = DistFromSMAOCave/sigma;

Plot zeroline = 0;
ZeroLine.SetDefaultColor(GetColor(1));

Pairs: Pair Arrows Single Ticker

# Insert bool arrows from pair study: DistFromMeanOpenCloseAve

input Pair = "AU";
input SMA_len = 10;
input R_len = 40;
input Std_Dev_Len = 20;
input Z_Thresh = 1.5;
input R_Thresh = .7;

def price = ((Open + Close) / 2) - ((open(Pair) + close(Pair)) / 2);
def SMAOC = Average(price, SMA_len);
def DistFromSMAOCave = price - SMAOC;
def sigma = stdev(price, Std_Dev_Len);
def zscore = DistFromSMAOCave/sigma;

plot ArrowDn = zscore > Z_Thresh and correlation(close, close(Pair), R_len) > R_Thresh;
#Mean_Dist < DistFromSMAOCave and correlation(close, close(Pair), R) > Mean_Dist;

plot ArrowUp = zscore < -Z_Thresh and correlation(close, close(Pair), R_len) > R_Thresh;
#-Mean_Dist > DistFromSMAOCave and correlation(close, close(Pair), R) > Mean_Dist;

ArrowUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
ArrowDn.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

Pairs: SMA OCave

#better to exclude tails/shadows and to use the midpoint of the
#body size when finding the usable distance from the mean

def price = ((Close + Open)/2);
input length = 10;
plot SMA = Average(price, length);
SMA.SetDefaultColor(GetColor(1));