Wednesday, July 25, 2012

Summary Book 1 - Chapter 3 Creating Trading Strategies

Quantitative trading strategies harnessing the power of quantitative techniques to create a winning trading program:

 3 building blocks for a trading system
1. Enteries - signals of buy and sell
2. Exits - indicate expected value of a trade has diminished to the point that the trade should be closed.
3. Filters - persuade the trader to only take entries with highest expected profits over the life of the system

Trend-following technique - buy signal while the market is in a period of strength.
sell signals are during period of weakness.

Moving average-the mean of a time series updated each trading day.
Most common moving averages are:Simple,Weighted, Exponential.

The simple moving average is an average of values recalculated every day.
Sum the previous days closing value and devide by the number of days.

Exponential moving average is calculated using todays price and yesterdays moving average value.alpha is the smoothing factor which is 2 devided by the number of days plus 1.

Sample Computation on EXCEL

A weighted moving average assigns higher weights to more recent data.

Trading signals are triggered when the price of a stock goes above the moving average, higher prices are likely and it signals that its time to buy.

When prices cross below the moving average, a declining market is expected and its time to sell.

a moving average of 20 to 100 days are commonly used to generate buy and sell signals. shorter moving averages will respond quicker to recent price movement.

longer moving averages produce trading signals infrequently.

when combining moving average methods such as exponential and simple, 10 and 40 days are used to generate signals.

if a market is prone to short and violent moves with many reversals along the way, moving average systems are likely to suffer. this drawback is called a whipsaw, asociated with choppy market action.

Channel breakout;
channels created when plotting a running tally of the highest highs and lowest lows over a fixed interval of days.

in a 40 day channel breakout: buy if market close was the highest of the past 40 days.
sell when the market close lower than any other close of the past 40 days.

A surge above the upper channel line shows extraordinary strength that can signal the start of an uptrend. Conversely, a plunge below the lower channel line shows serious weakness that can signal the start of a downtrend

Momentum-
take the difference between one value and another value at some point in time.
Momentum = Value Today - Value X days ago

Buy when todays close is greater than the close x days ago
Sell when todays close is less than the close x days ago

Volatility breakouts-
large short-term price jumps tend to be precursors of further movement in the same direction.
it is comprised of 3 pieces:
1. reference value - measurement price of the move from the start
2. volatility measure - computes the typical valatility of the market to separate significant movement from random price changes
3. volatility multiplier - determines the sensitivity of price movement required to trigger entry signals.

buy when prices close above the upper trigger.
sell when prices close below the lower trigger.

the most logical valatility measure is to calculate a standard deviation of price returns.


another volatility measure is to calculate the average true range.
1. the largest value of todays high minus todays low
2. largest value of todays high minus yesterdays close
3. largest value of yesterdays close minus todays low

 Excel Sheet showing how to calculate the 14 day Average True Range


average the true range over a set number of days to calculate ATR (average true range)

another volatility measure is the standard deviation of market prices.
this method does not allow strict interpretation using the normal distribution.

Volatility breakout entry points are derived by multiplying the volatility multiplier
by the volatility measure and adding that value to the reference value.

Volatility Breakout Rules
-Upper trigger = Reference Value (yesterday’s close, today’s open, short-term moving average) plus the Volatility Multiplier times Volatility Measure (standard deviation of price returns, average true range, standard deviation of
price). Buy when today’s close is greater than the upper trigger.
-Lower trigger = Reference Value (yesterday’s close, today’s open, short-term moving average) plus the Volatility Multiplier times Volatility Measure (standard deviation of price returns, average true range, standard deviation of
price). Sell when today’s close is less than the lower trigger

When a trend has become overextended or exhausted we define the technique as an Oscillator.

Sell signals are given using range statistics to explain that prices have risen too high and buy signals when prices are too low.

the premise behind standard oscillators is that once prices move to levels far from average, a reversal is eminent.

one method is the Relative strength index(RSI is the most popular). a market top is completed when the indicator rises above 70, while bottoms when fall below 30.

RSI sums the price changes of up days and compares them with the price changes of down days to calculate the RSI value.

RSI = 100 - ( 100 / (  1+  (U/D)  )  )
U is the average of all up moves
D is the average of all down moves

NOTE: The Relative Strength Index (RSI) rises and falls between 0 and 100

a stochastic oscillator compares current prices to the high and low range over a look-back period.

Traditional settings use 80 as the overbought threshold and 20 as the oversold threshold
stochastic oscillator

Fast %K stochastic is a smoothed out raw %K using a 3 day moving average
The fast %D stochastic is the smoothed out of the fast %K stochastic using another 3 day moving average.


the Raw %K stochastics = (Todays Close - Lowest low) / (Highest High - lowest low)

The moving average Convergence/Divergence (MACD) is an oscillator created by taking the difference between two exponential

averages.
1. a 12 day exponential weighted average with alpha=0.15
2. a 26 day exponential moving average with alpha=0.075

MACD = 12 Day EMA of close - 26  day EMA of close
MACD signal = 9 Day EMA of MACD

a popular patter of prices
SELL - Key reversal sell
todays high > yesterdays high
todays close < yesterdays close

BUY-key reversal buy
Todays Low < yesterdays low
Todays close > yesterdays close

signals that close profitable trades are called EXITS
signals that close unprofitable trades are called "STOPS"
Profit Targets close profitable

trades using range statistics.if we buy IBM at 100$ and the average true range of the past 20 days above the entry price of 100$ is 2$ then we sell at
100$ + (3)(2$) = 106$ we sell at 106$

A trailing exit has many examples to lock in profit before trade turns.
exit when market makes a 5 day low.
exit when market closes below previous pivot point

a pivot point is created when one days low is lower than both the

previous and following days low. (V Shape)
2 days before and 2 days after. or
3 days before and 3 days after.

LOSING IS A PART OF ALL TRADING (page 94 fail-safe exits)

FAIL SAFE EXIT
the trade goes against you by an amount equal to 2 times the average true range of the past 20 days.

if we buy IBM at 100$ and the average true range is 1.5$ we sell if 100 - (2*1.5$) = 97$ to minimize losses.

filters are used to either give a green light to trade or a red light that overrides buy and sell signal.

Trend filters:
Average directional movement index (ADX)
Vertical Horizontal Filter (VHF)

A typical use of a filter is to only take signals when values of these filters are greater than some threshold.

OUTSIDE BOOK SCOPE:
ADX is used to determine the direction and strength of a trend.

1. Calculate the True Range (TR), Plus Directional Movement (+DM) and Minus Directional Movement (-DM) for each period.

2. Smooth these periodic values using the Wilder's smoothing techniques. These are explained in detail in the next section.

3. Divide the 14-day smoothed Plus Directional Movement (+DM) by the 14-day smoothed True Range to find the 14-day Plus Directional Indicator (+DI14). Multiply by 100 to move the decimal point two places. This +DI14 is the Plus Directional Indicator (green line) that is plotted along with ADX.

4. Divide the 14-day smoothed Minus Directional Movement (-DM) by the 14-day smoothed True Range to find the 14-day Minus Directional Indicator (-DI14). Multiply by 100 to move the decimal point two places. This -DI14 is the Minus Directional Indicator (red line) that is plotted along with ADX.

5. The Directional Movement Index (DX) equals the absolute value of +DI14 less - DI14 divided by the sum of +DI14 and - DI14.

6. After all these steps, it is time to calculate the Average Directional Index (ADX). The first ADX value is simply a 14-day average of DX. Subsequent ADX values are smoothed by multiplying the previous 14-day ADX value by 13, adding the most recent DX value and dividing this total by 14.



strong trend is present when ADX is above 25 and no trend is present when below 20.

  • Theory: Large moves are a result of new information entering the markets.This information may not be immediately digested by all market participants.
  • Trading rule: Buy when today’s price change is greater than two standard deviations of the 20-day standard deviation of price changes.
  1. Formulate a theory
  2. Create an experiment
  3. draw conclusion

"I learned that following a detailed trading plan based
on sound historical results is the only way to trade effectively. And oh yeah, make
sure you’re awake and sober when placing your trades."

No comments:

Post a Comment