Lectures 5A, 5B and 6 — definitions and formulae
Recall only: no calculation drills, chart scenarios or coding exercises. Formulae use the conventions and caveats in the lecture notes.
L5A Other Popular Strategies (18 cards)
What is pairs trading (statistical arbitrage)?
Trading a temporary deviation between historically related instruments, expecting their spread to revert toward its usual level.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
What key assumption underlies pairs trading?
The relationship between the pair remains intact and the deviation is temporary, rather than a fundamental divergence.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
What is the z-score formula for a pairs-trading spread?
(z=(x-\mu)/\sigma), where (x) is the current spread (defined consistently, e.g. difference of returns), (\mu) its historical mean and (\sigma) its historical standard deviation.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
What does a spread’s z-score measure?
How many standard deviations the current spread lies above or below its historical mean.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
In pairs trading, must both legs be profitable for convergence to yield a profit?
No. The gain on one leg can exceed the loss on the other.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
What is the main failure risk of a mean-reverting pairs trade?
The instruments diverge for fundamental reasons, so the historical relationship does not recover.
Source: L5A Other Popular Strategies > Statistical Arbitrage / Pairs Trading
What is cross-exchange arbitrage?
Buying an instrument on the cheaper exchange and selling it on the more expensive exchange to exploit a price discrepancy.
Source: L5A Other Popular Strategies > Arbitrage
What is grid trading?
Placing multiple buy and sell orders at spaced price levels within a range to capture repeated price fluctuations.
Source: L5A Other Popular Strategies > Grid Trading
Where are the initial buy and sell limit orders placed in the lecture’s grid strategy?
Buy limits below the current price; sell limits above the current price.
Source: L5A Other Popular Strategies > Grid Trading
What market behaviour does grid trading assume?
Range-bound, mean-reverting price movements: repeated oscillation within a recurring range.
Source: L5A Other Popular Strategies > Grid Trading
What is the main risk of grid trading?
A sustained breakout: price continues beyond the range and does not return to close the opposite side profitably.
Source: L5A Other Popular Strategies > Grid Trading
What determines a candlestick’s real body?
The opening and closing prices. Body size indicates the magnitude of the open-to-close move and helps reflect buying or selling pressure.
Source: L5A Other Popular Strategies > Candlestick Patterns
What is a doji, and what does it represent?
A candle with approximately equal open and close, hence a very small body. It represents indecision, not an automatic reversal.
Source: L5A Other Popular Strategies > Candlestick Patterns
Why must a candlestick pattern be read in context?
Its meaning depends on the preceding trend and confirmation from subsequent price action or other evidence.
Source: L5A Other Popular Strategies > Candlestick Patterns
Which three single/two-candle bullish patterns are listed in L5A?
Hammer, inverted hammer and bullish engulfing.
Source: L5A Other Popular Strategies > Candlestick Patterns
Which other three bullish patterns are listed in L5A?
Morning star, piercing line and three white soldiers.
Source: L5A Other Popular Strategies > Candlestick Patterns
Which three single/two-candle bearish patterns are listed in L5A?
Shooting star, hanging man and bearish engulfing.
Source: L5A Other Popular Strategies > Candlestick Patterns
Which other three bearish patterns are listed in L5A?
Evening star, dark cloud cover and three black crows.
Source: L5A Other Popular Strategies > Candlestick Patterns
L5B Technical Analysis (44 cards)
What is technical analysis (TA)?
The study of price action, primarily prices and volumes, through charts and mathematical indicators.
Source: L5B Technical Analysis > What is TA?
What are the three premises of technical analysis?
Market action discounts everything; prices move in trends; history repeats itself.
Source: L5B Technical Analysis > Foundation of TA
What does “market action discounts everything” mean in TA?
Relevant influences are reflected in market prices; price action expresses the resulting supply and demand.
Source: L5B Technical Analysis > Foundation of TA
What does the TA premise “prices move in trends” imply?
An established trend is more likely to continue than reverse until a force changes it.
Source: L5B Technical Analysis > Foundation of TA
What explains the TA premise “history repeats itself”?
Recurring investor psychology and collective behaviour, particularly fear and greed, produce recurring patterns.
Source: L5B Technical Analysis > Foundation of TA
What is a primary trend, and what is its typical duration in the notes?
The overall market direction, lasting months to years.
Source: L5B Technical Analysis > Foundation of TA
What is a secondary trend, and what is its typical duration in the notes?
A countertrend or mean-reverting movement within the primary trend, lasting days to months.
Source: L5B Technical Analysis > Foundation of TA
What is a minor (tertiary) trend, and what is its typical duration?
Short-term fluctuations within larger trends, lasting minutes or hours to days.
Source: L5B Technical Analysis > Foundation of TA
What does it mean that price trends and patterns are fractal?
Similar patterns occur across different timeframes.
Source: L5B Technical Analysis > Foundation of TA
What defines an uptrend?
Successive higher highs and higher lows.
Source: L5B Technical Analysis > Uptrend Downtrend Sideways
What defines a downtrend?
Successive lower highs and lower lows.
Source: L5B Technical Analysis > Uptrend Downtrend Sideways
What defines a sideways or choppy market?
Highs and lows remain within roughly the same zones, with no sustained uptrend or downtrend.
Source: L5B Technical Analysis > Uptrend Downtrend Sideways
Which points define an uptrend line versus a downtrend line?
Uptrend: join supportive troughs. Downtrend: join resistive peaks. At least two points establish a tentative line.
Source: L5B Technical Analysis > Uptrend Downtrend Sideways
What is “confirmation by averages” in Dow Theory?
The industrial and transport averages should trend in the same direction to confirm a market signal.
Source: L5B Technical Analysis > Dow Theory
What do DJIA and DJTA stand for?
Dow Jones Industrial Average and Dow Jones Transportation Average.
Source: L5B Technical Analysis > Dow Theory
Why does Dow Theory compare industrial and transport averages?
Producers and the firms transporting their goods should show consistent economic strength or weakness.
Source: L5B Technical Analysis > Dow Theory
What is a support level?
A price area where buying pressure tends to halt or reverse a decline.
Source: L5B Technical Analysis > Support and Resistances
What is a resistance level?
A price area where selling pressure tends to halt or reverse a rise.
Source: L5B Technical Analysis > Support and Resistances
What is support/resistance role reversal?
Broken resistance may become support; broken support may become resistance.
Source: L5B Technical Analysis > Support and Resistances
What psychological mechanism helps create support and resistance?
Traders remember earlier prices and outcomes; their repeated buying and selling decisions concentrate demand or supply at those levels.
Source: L5B Technical Analysis > Support and Resistances
What is the standard pivot-point formula?
(P=(H+L+C)/3), using the reference period’s high (H), low (L) and close (C).
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What is the first pivot resistance formula, R₁?
(R_1=2P-L), where (P) is the pivot and (L) the reference-period low.
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What is the second pivot resistance formula, R₂?
(R_2=P+(H-L)).
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What is the first pivot support formula, S₁?
(S_1=2P-H), where (H) is the reference-period high.
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What is the second pivot support formula, S₂?
(S_2=P-(H-L)).
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What market-condition caveat accompanies the pivot formulas in the notes?
They are presented for normal trading without major news or events.
Source: L5B Technical Analysis > Pivot Points - To calculate S&R
What is a technical indicator?
A mathematical derivation of price and/or volume used to identify patterns and confirm signals.
Source: L5B Technical Analysis > Indicators
Why are technical indicators generally lagging?
They are calculated from price and volume observations that have already occurred.
Source: L5B Technical Analysis > Indicators
What is an indicator’s lookback period?
The amount or number of periods of historical data used to calculate it.
Source: L5B Technical Analysis > Indicators
What is relative volume (RVOL), and what is its formula?
Current volume relative to its recent average: (\mathrm{RVOL}=V_{\mathrm{current}}/\overline V_{\mathrm{lookback}}).
Source: L5B Technical Analysis > Indicators
What does RVOL ≈ 1 mean?
Current trading volume is near its average over the selected lookback period.
Source: L5B Technical Analysis > Indicators
Does high RVOL identify the direction of a price move?
No. It indicates unusual trading activity or interest, not whether price will rise or fall.
Source: L5B Technical Analysis > Indicators
What is the purpose of a moving average?
To smooth price fluctuations, reduce noise and make the underlying trend easier to interpret.
Source: L5B Technical Analysis > Moving Averages
What is the N-period simple moving average formula?
(\mathrm{SMA}t=\frac{1}{N}\sum{i=0}^{N-1}P_{t-i}). Each of the N observations has equal weight.
Source: L5B Technical Analysis > Moving Averages
How does an EMA differ from an SMA?
An exponential moving average gives greater weight to recent observations; an SMA gives equal weight within its window.
Source: L5B Technical Analysis > Moving Averages
What distinguishes a fast moving average from a slow one?
A fast MA has a shorter lookback and responds more quickly; a slow MA has a longer lookback and responds more slowly.
Source: L5B Technical Analysis > Moving Averages
What is a moving-average crossover?
An event in which a faster MA crosses above or below a slower MA, indicating a change in relative momentum.
Source: L5B Technical Analysis > Strategy Moving Averages
What are moving-average bands or envelopes?
Upper and lower boundaries around a moving average, using a chosen distance or dispersion measure.
Source: L5B Technical Analysis > Strategy Moving Averages
What does RSI stand for, and what range does it occupy?
Relative Strength Index; it ranges from 0 to 100.
Source: L5B Technical Analysis > RSI
What is the relative strength (RS) formula used in RSI?
(RS=\text{Average gain}/\text{Average loss}), with losses expressed as positive magnitudes over the chosen lookback.
Source: L5B Technical Analysis > RSI
What is the RSI formula in terms of RS?
(\mathrm{RSI}=100-\frac{100}{1+RS}).
Source: L5B Technical Analysis > RSI
What is the common RSI lookback stated in the notes?
14 periods (14 days for daily data).
Source: L5B Technical Analysis > RSI
What are the conventional RSI overbought and oversold thresholds?
70 for overbought and 30 for oversold. These are conventions, not universal thresholds for every instrument.
Source: L5B Technical Analysis > RSI
What is bearish price–RSI divergence?
Price rises or makes a higher high while RSI falls or fails to confirm that high, suggesting weakening upward momentum.
Source: L5B Technical Analysis > RSI
L6 Systematic Trading Strategies and Systems (47 cards)
What is systematic trading?
Rule-based (mechanical) trading that uses data to define and test decisions, control risk and execute consistently.
Source: L6 Systematic Trading Strategies and Systems > What is Systematic Trading
Must systematic trading be fully automated?
No. It can be automatic, semi-automatic or manual, provided decisions follow defined rules.
Source: L6 Systematic Trading Strategies and Systems > What is Systematic Trading
What distinguishes a trading rule, its variables and its parameters?
Rule: the decision logic. Variables: quantities used by the rule. Parameters: chosen settings, such as moving-average window lengths.
Source: L6 Systematic Trading Strategies and Systems > What is Systematic Trading
What behavioural problem does systematic trading aim to reduce?
Emotional and inconsistent decisions driven by fear and greed.
Source: L6 Systematic Trading Strategies and Systems > What is Systematic Trading
What is backtesting?
Simulating a trading rule on historical data to evaluate how it would have performed.
Source: L6 Systematic Trading Strategies and Systems > Backtesting
What are the main steps in a backtest?
Obtain historical data; simulate signals and buy/sell points; calculate P&L and performance metrics; compare rule variations to select a model.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Steps
What is the central limitation of historical backtest performance?
Historical patterns may not persist; good past performance does not guarantee future results.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Steps
What is an in-sample backtest?
Select a model or variation using a historical dataset and report performance on that same dataset.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
Why can in-sample backtest results be too optimistic?
The model is selected to fit the evaluated data, so performance can reflect overfitting, including information from later years relative to earlier evaluated years.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is an out-of-sample backtest?
Select or fit a model on an earlier training period, then evaluate it on a later, unseen test period.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is an expanding-window backtest?
Repeatedly fit on all available earlier data and test on the next period; the training window grows after each step.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is a rolling-window backtest?
Repeatedly fit on a fixed-length recent training window, test on the next period, then move the window forward and drop the oldest data.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is the key distinction between expanding and rolling training windows?
Expanding retains all past training data; rolling retains a fixed-length recent history.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is walk-forward testing?
Sequential testing where each test period uses a model fitted only on earlier data; expanding and rolling windows are examples.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is the main trade-off of a rolling training window?
It focuses on recent market conditions but uses less historical training data.
Source: L6 Systematic Trading Strategies and Systems > Backtesting Types
What is a strategy variation?
A different parameter setting for the same trading rule, such as different MA lengths.
Source: L6 Systematic Trading Strategies and Systems > Variations in Backtesting
What is overfitting in backtest model selection?
Selecting a rule or parameters that capture historical noise or luck rather than a persistent pattern.
Source: L6 Systematic Trading Strategies and Systems > Variations in Backtesting
Why does testing more variations increase overfitting risk?
It increases the chance of finding an apparently excellent historical result purely by luck.
Source: L6 Systematic Trading Strategies and Systems > Variations in Backtesting
If test performance influences model selection, is that period still an independent test?
No. It has become part of selection; evaluate the final choice on fresh unseen data.
Source: L6 Systematic Trading Strategies and Systems > Variations in Backtesting
What three approaches to handling many variations are listed in the notes?
Choose the best, choose randomly, or combine variations with equal or unequal weights.
Source: L6 Systematic Trading Strategies and Systems > Variations in Backtesting
What weighting methods for combined variations are listed in the notes?
Equal weights, optimised weights and bootstrapped weights.
Source: L6 Systematic Trading Strategies and Systems > Best Practices
How does true Sharpe ratio affect the evidence needed to establish profitability?
Lower true Sharpe generally requires more data to distinguish performance from noise; a short history can give an unreliable Sharpe estimate.
Source: L6 Systematic Trading Strategies and Systems > How much data is needed?
What is vectorised backtesting in the lecture’s simplified setup?
Dataframe-based calculations of signals and overall returns, without explicitly simulating individual executions and portfolio cash flows.
Source: L6 Systematic Trading Strategies and Systems > Vectorised vs Event Based Backtesting
What is event-based backtesting?
A sequential simulation that explicitly models trading events, executions and portfolio changes.
Source: L6 Systematic Trading Strategies and Systems > Vectorised vs Event Based Backtesting
Which quantities can an event-based backtest explicitly track?
Position sizes, cash balances, P&L, transaction costs, leverage and risk/money-management rules.
Source: L6 Systematic Trading Strategies and Systems > Vectorised vs Event Based Backtesting
What is the main trade-off between the lecture’s vectorised and event-based approaches?
Vectorised: computationally efficient and easier to implement. Event-based: more realistic execution and portfolio modelling, with greater coding complexity.
Source: L6 Systematic Trading Strategies and Systems > Vectorised vs Event Based Backtesting
What does Position represent in the L6 long/short MA model?
The holding direction: +1 for long and −1 for short.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What is the formula for Signal in terms of Position?
(\mathrm{Signal}_t=\mathrm{Position}t-\mathrm{Position}{t-1}).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What do Signal values +2, −2 and 0 mean in the L6 model?
+2: short to long. −2: long to short. 0: no change of position.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What is the stock log-return formula?
(r_t=\ln(P_t/P_{t-1})), where (P_t) is the closing price at time t.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What is the simplified L6 strategy-return formula?
(r^{\mathrm{strategy}}t=q{t-1}r_t), where (q_{t-1}) is the previous period’s position and (r_t) the current stock log return.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
Why does the L6 strategy-return formula use the previous period’s position?
The position determined at today’s close earns the next period’s return. Using today’s close-derived position for today’s return introduces look-ahead bias.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What is look-ahead bias?
Using information in a historical decision that would not yet have been available at that decision time.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What caveats apply to the L6 signed-log-return strategy calculation?
It assumes simplified execution at the signal close without costs; negating a stock’s log return is an approximation for a short position’s return.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How do log returns aggregate over time?
They add: (r_{1:T}=\sum_{t=1}^{T}r_t).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How is the growth of one unit of wealth calculated from log returns?
(W_T=\exp(\sum_{t=1}^{T}r_t)), with initial wealth (W_0=1).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How is cumulative simple return calculated from log returns?
(R_{1:T}=\exp(\sum_{t=1}^{T}r_t)-1).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How is mean daily log return annualised using 252 trading days?
(\mu_{\mathrm{annual,log}}=252\mu_{\mathrm{daily,log}}).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How is daily return standard deviation annualised in the notes?
(\sigma_{\mathrm{annual}}=\sqrt{252},\sigma_{\mathrm{daily}}), under the square-root-of-time scaling assumption.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
How is an annualised log return converted to a simple return?
(R_{\mathrm{annual}}=\exp(252\mu_{\mathrm{daily,log}})-1).
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What Sharpe convention does the L6 notebook use?
Zero risk-free rate, with annual return converted from log returns: (\mathrm{SR}=\frac{\exp(252\mu_{\mathrm{daily,log}})-1}{\sqrt{252},\sigma_{\mathrm{daily}}}). This is the notebook’s stated convention.
Source: L6 Systematic Trading Strategies and Systems > Notebook code snippets
What is drawdown?
The fall in wealth or equity below its running historical peak.
Source: L6 Systematic Trading Strategies and Systems > Drawdown
What is the running-peak formula when initial wealth is 1?
(M_t=\max(1,W_1,\ldots,W_t)), including the initial wealth in the peak.
Source: L6 Systematic Trading Strategies and Systems > Drawdown
What is the absolute drawdown formula used in the notebook?
(D_t=M_t-W_t), in wealth units, where (M_t) is the running peak and (W_t) current wealth.
Source: L6 Systematic Trading Strategies and Systems > Drawdown
What is the percentage drawdown formula?
(d_t=1-W_t/M_t). Multiply by 100 to express it as a percentage.
Source: L6 Systematic Trading Strategies and Systems > Drawdown
What is maximum drawdown?
The largest drawdown during the evaluation period: (\mathrm{MDD}=\max_t D_t) for absolute drawdown, or (\max_t d_t) for proportional drawdown.
Source: L6 Systematic Trading Strategies and Systems > Drawdown
What limitation does the notebook’s longest-drawdown calculation have?
Using gaps between peak dates misses a drawdown that remains unrecovered at the end of the dataset.
Source: L6 Systematic Trading Strategies and Systems > Drawdown