Level 5 — MasteryTrading Psychology

Trading Psychology

90 minutes60 marksprintable — key stays hidden on paper

Chapter: 4.8 Trading Psychology Level: 5 — Mastery (cross-domain: probability, coding, systems design & proof) Time limit: 90 minutes Total marks: 60

Instructions: Answer all three questions. Show all derivations. Where code is required, write clean pseudo-Python. Justify every modelling assumption. Use ...... / ...... for mathematics.


Question 1 — Discipline, Losing Streaks & Risk of Ruin (24 marks)

A disciplined trader follows a written plan (4.8.6) with a fixed edge. Each trade independently either wins with probability pp (net gain +R+R times risked amount) or loses with probability q=1pq=1-p (loss of 11 unit risked). The trader risks a fixed fraction ff of current bankroll per trade.

(a) For a discrete fixed-fraction model, derive the expected log-growth per trade g(f)=pln(1+fR)+qln(1f).g(f) = p\ln(1+fR) + q\ln(1-f). Show that the growth-optimal fraction (Kelly) is f\*=pRqR.f^\* = \frac{pR - q}{R}. Explain, in terms of process over outcome (4.8.10) and fear/greed (4.8.2), why a disciplined trader typically deploys a fraction f=12f\*f = \tfrac{1}{2}f^\* rather than full Kelly. (8 marks)

(b) Take p=0.55p=0.55, R=1R=1. Compute f\*f^\*, the full-Kelly growth rate g(f\*)g(f^\*), and the half-Kelly growth rate g(12f\*)g(\tfrac12 f^\*). Comment on the risk trade-off. (8 marks)

(c) A losing streak (4.8.11) of length kk occurs with probability qkq^k for consecutive independent losses. With p=0.55p=0.55, compute the probability of a run of at least 55 consecutive losses starting on a given trade, and the expected number of trades between the start of such runs. Explain how this statistic should be pre-committed in the trading plan to prevent tilt (4.8.5) and revenge trading (4.8.4). (8 marks)


Question 2 — Backtesting, Overfitting & the FOMO Filter (20 marks)

(a) A trader backtests (4.8.8) NN independent random strategies with no real edge, each producing an annual Sharpe ratio that is approximately N(0,1)\mathcal{N}(0,1) under the null. Show that the expected maximum Sharpe of the best of NN strategies grows like E[max]2lnN.\mathbb{E}[\max] \approx \sqrt{2\ln N}. Compute this for N=1000N=1000 and explain why the "best backtest" is a FOMO trap (4.8.3). (8 marks)

(b) Write pseudo-code for a walk-forward backtest that (i) splits data into in-sample/out-of-sample folds, (ii) selects parameters in-sample, (iii) records out-of-sample performance, and (iv) flags a strategy as overfit if in-sample Sharpe exceeds out-of-sample Sharpe by more than a threshold τ\tau. Justify each design choice against a discipline/consistency criterion (4.8.1). (8 marks)

(c) Explain quantitatively why paper/demo trading (4.8.9) with realistic slippage is a necessary but not sufficient validation step before live deployment. Give one psychological variable that paper trading fails to test. (4 marks)


Question 3 — Build a Journaling & Emotional-Control System (16 marks)

Design a quantitative trade-journal + pre-market-routine system (4.8.7, 4.8.12) that enforces process discipline.

(a) Define an Emotional-Discipline Score DD as a weighted function of measurable per-trade flags: plan-adherence a{0,1}a\in\{0,1\}, position-size-within-limit s{0,1}s\in\{0,1\}, no-revenge-entry r{0,1}r\in\{0,1\}, journaled-within-1h j{0,1}j\in\{0,1\}. Propose weights wa,ws,wr,wjw_a,w_s,w_r,w_j summing to 11, justify the ordering of weights, and give the formula for the rolling 20-trade mean Dˉ\bar D. State the threshold below which the trader must halt (tilt lock-out). (8 marks)

(b) Prove that if a trader's decisions maximise expected process score independently of outcome, then over many trades the realised P&L converges (in probability) to the strategy's true expectation μ\mu per trade, invoking the Weak Law of Large Numbers. State the assumptions clearly. (8 marks)


Answer keyMark scheme & solutions

Question 1

(a) [8 marks]

  • Bankroll after nn trades: Bn=B0(1+fR)win(1f)lossB_n = B_0\prod (1+f R)^{\text{win}}(1-f)^{\text{loss}}. Taking log and dividing by nn, the per-trade expected log return is the expectation of the log multiplier: g(f)=pln(1+fR)+qln(1f)g(f)=p\ln(1+fR)+q\ln(1-f). (3)
  • Maximise: g(f)=pR1+fRq1f=0g'(f)=\dfrac{pR}{1+fR}-\dfrac{q}{1-f}=0. (2)
  • Cross-multiply: pR(1f)=q(1+fR)pRpRf=q+qfRpR(1-f)=q(1+fR)\Rightarrow pR-pRf = q+qfR. Collect: pRq=fR(p+q)=fRpR-q = f R(p+q)=fR. Hence f\*=pRqRf^\*=\dfrac{pR-q}{R}. (2)
  • Half-Kelly rationale: variance of log-growth scales roughly with f2f^2 while growth is near-flat around the optimum (concave, zero first derivative at f\*f^\*); half-Kelly captures ~75% of growth with ~half the volatility → reduces drawdown-induced fear/greed deviations and keeps the trader in the process (4.8.10). (1)

(b) [8 marks] With p=0.55,q=0.45,R=1p=0.55,q=0.45,R=1:

  • f\*=0.5510.451=0.10f^\* = \dfrac{0.55\cdot1-0.45}{1}=0.10. (2)
  • g(f\*)=0.55ln(1.10)+0.45ln(0.90)=0.55(0.095310)+0.45(0.105361)=0.0524210.047412=0.005008g(f^\*)=0.55\ln(1.10)+0.45\ln(0.90)=0.55(0.095310)+0.45(-0.105361)=0.052421-0.047412=0.005008. (3)
  • Half-Kelly f=0.05f=0.05: g=0.55ln(1.05)+0.45ln(0.95)=0.55(0.048790)+0.45(0.051293)=0.0268350.023082=0.003753g=0.55\ln(1.05)+0.45\ln(0.95)=0.55(0.048790)+0.45(-0.051293)=0.026835-0.023082=0.003753. (2)
  • Comment: half-Kelly gives ≈75% of the growth rate (0.003753/0.0050080.750.003753/0.005008\approx0.75) with substantially lower drawdown variance — favourable risk trade-off. (1)

(c) [8 marks] q=0.45q=0.45.

  • P(5 consecutive losses)=q5=0.455=0.01845280.01845P(\ge5 \text{ consecutive losses}) = q^5 = 0.45^5 = 0.0184528\approx 0.01845. (3)
  • Expected trades between starts of such runs 1/q5=1/0.018452854.2\approx 1/q^5 = 1/0.0184528 \approx 54.2 trades. (3)
  • Plan use: because a 5-loss streak is expected roughly every ~54 trades, it is a normal statistical event, not a signal of broken edge. Pre-committing a max-consecutive-loss stop and a cooling-off rule prevents interpreting variance as failure → blocks tilt (4.8.5) and revenge trading (4.8.4). (2)

Question 2

(a) [8 marks]

  • For NN i.i.d. standard normals, the maximum concentrates near the level xx where N(1Φ(x))1N(1-\Phi(x))\approx 1, i.e. 1Φ(x)1/N1-\Phi(x)\approx 1/N. (3)
  • Using tail bound 1Φ(x)ϕ(x)/xex2/21-\Phi(x)\approx \phi(x)/x \sim e^{-x^2/2}, set ex2/21/Nx2/2lnNx2lnNe^{-x^2/2}\approx 1/N \Rightarrow x^2/2\approx \ln N \Rightarrow x\approx\sqrt{2\ln N}. (3)
  • N=1000N=1000: 2ln1000=2(6.90776)=13.8155=3.717\sqrt{2\ln 1000}=\sqrt{2(6.90776)}=\sqrt{13.8155}=3.717. So the best of 1000 no-edge strategies shows Sharpe ≈3.7 by chance. (1)
  • FOMO trap (4.8.3): chasing the top backtest = selecting noise; disciplined process rejects the strategy unless it survives multiple-testing correction/out-of-sample. (1)

(b) [8 marks] Sample pseudo-code (mark for correct structure):

def walk_forward(data, param_grid, folds, tau):
    flags = []
    for train, test in split_folds(data, folds):   # chronological, no leakage
        best_p = argmax(param_grid, key=lambda p: sharpe(backtest(train, p)))
        is_sharpe  = sharpe(backtest(train, best_p))
        oos_sharpe = sharpe(backtest(test,  best_p))
        flags.append(is_sharpe - oos_sharpe > tau)  # overfit flag
    overfit = mean(flags) > 0.5
    return overfit
  • Chronological split (no lookahead) — enforces realism/consistency (4.8.1). (2)
  • Params chosen in-sample only, scored out-of-sample — separates fitting from validation. (2)
  • τ\tau threshold operationalises "degradation" objectively → removes discretionary/emotional override. (2)
  • Majority-of-folds decision → robust to single-fold luck. (2)

(c) [4 marks]

  • Paper trading validates mechanics/slippage/logic (necessary) but P&L is not real, so it does not test loss-aversion, fear, greed and tilt under real financial/emotional stress (not sufficient). Named psychological variable: emotional response to real capital loss / fear of realising losses. (4)

Question 3

(a) [8 marks]

  • Proposed weights (ordering justified by severity of rule-breach): risk control first. ws=0.35w_s=0.35 (position-size breach can cause ruin), wr=0.30w_r=0.30 (revenge entries are highest-EV-destroying), wa=0.25w_a=0.25 (plan adherence), wj=0.10w_j=0.10 (journaling supports learning but is lowest immediate risk). Sum =1.00=1.00. (3)
  • Per-trade score Di=waa+wss+wrr+wjj[0,1]D_i = w_a a + w_s s + w_r r + w_j j \in[0,1]. (2)
  • Rolling mean Dˉ=120i=n19nDi\bar D = \frac{1}{20}\sum_{i=n-19}^{n} D_i. (1)
  • Lock-out threshold: halt trading if Dˉ<0.80\bar D < 0.80 (i.e. discipline slipping) until a review is logged — enforces cool-down. Any justified threshold in [0.7,0.85][0.7,0.85] accepted. (2)

(b) [8 marks]

  • Assumptions: per-trade P&L XiX_i are i.i.d. with finite mean μ=E[X]\mu=\mathbb{E}[X] and finite variance σ2\sigma^2; decisions depend only on the process (entry rules), so outcomes don't alter the rule set → i.i.d. preserved. (3)
  • Sample mean Xˉn=1nXi\bar X_n=\frac1n\sum X_i. WLLN: for any ε>0\varepsilon>0, P(Xˉnμ>ε)0P(|\bar X_n-\mu|>\varepsilon)\to 0 as nn\to\infty. (3)
  • (Chebyshev proof) P(Xˉnμ>ε)Var(Xˉn)ε2=σ2nε20P(|\bar X_n-\mu|>\varepsilon)\le \dfrac{\operatorname{Var}(\bar X_n)}{\varepsilon^2}=\dfrac{\sigma^2}{n\varepsilon^2}\to 0. (2)
  • Interpretation: process-focused discipline keeps the distribution stationary; realised P&L then converges to the true edge, which is why traders must judge process not short-run outcome (4.8.10). Emotional deviation breaks the i.i.d. assumption and invalidates the guarantee.
[
 {"claim":"Kelly fraction f* = 0.10 for p=0.55,R=1","code":"p=Rational(55,100);q=1-p;R=1;fstar=(p*R-q)/R;result=(fstar==Rational(1,10))"},
 {"claim":"Full-Kelly growth rate ~0.005008","code":"import sympy as sp;p=sp.Rational(55,100);q=sp.Rational(45,100);f=sp.Rational(1,10);g=p*sp.log(1+f)+q*sp.log(1-f);result=abs(float(g)-0.005008)<1e-5"},
 {"claim":"Half-Kelly growth ~0.003753 and about 75% of full","code":"import sympy as sp;p=sp.Rational(55,100);q=sp.Rational(45,100);gf=p*sp.log(sp.Rational(105,100))+q*sp.log(sp.Rational(95,100));gk=p*sp.log(sp.Rational(11,10))+q*sp.log(sp.Rational(9,10));result=abs(float(gf)-0.003753)<1e-5 and abs(float(gf/gk)-0.75)<0.02"},
 {"claim":"P(>=5 losses)=0.45**5 ~0.01845 and expected gap ~54.2","code":"q=0.45;p5=q**5;gap=1/p5;result=abs(p5-0.0184528)<1e-6 and abs(gap-54.19)<0.5"},
 {"claim":"sqrt(2 ln 1000) ~ 3.717","code":"import sympy as sp;val=sp.sqrt(2*sp.log(1000));result=abs(float(val)-3.717)<1e-3"}
]