What to Trade
Chapter: 4.2 What to Trade Level: 3 — Production (from-scratch derivations, code-from-memory, explain-out-loud) Time Limit: 45 minutes Total Marks: 60
Instructions: Show all working. Derive formulas from first principles where asked. Code answers may be pseudocode but must be logically complete. Use for math.
Question 1 — Liquidity & Instrument Choice (10 marks)
(a) From first principles, derive an expression for the round-trip transaction cost (as a fraction of trade value) for a market order in a stock, in terms of the bid–ask spread , mid-price , and brokerage rate (per side). Explain each term out loud. (4)
(b) Stock A has bid/ask of ; Stock B has bid/ask of . Both trade at mid , brokerage per side. Compute round-trip cost fraction for each. (4)
(c) State the decision rule you would use to choose between the two for a scalping strategy, and justify. (2)
Question 2 — Index Trading & Weighting (12 marks)
(a) Derive the formula for a free-float market-cap weighted index value from scratch, defining the divisor and explaining why a divisor is needed. (4)
(b) An index has 3 constituents:
| Stock | Price | Free-float shares |
|---|---|---|
| X | 500 | 100 |
| Y | 300 | 200 |
| Z | 800 | 50 |
If the base free-float market cap corresponds to index value 1000 with divisor , compute (take base = current). Then compute the new index value if X rises to 550. (5)
(c) Explain out loud why Bank Nifty is more volatile than Nifty 50, referencing concentration. (3)
Question 3 — F&O Payoff Derivation (12 marks)
(a) Derive from scratch the payoff at expiry of a long call and a short put on the same strike and premium notation. Sketch/describe the payoff profiles. (5)
(b) A trader is long a Nifty future at and long a put at premium . Derive the combined payoff expression and identify the maximum loss. (5)
(c) Name this combined position and explain out loud what market view it expresses. (2)
Question 4 — Correlation From Scratch (12 marks)
(a) Write the Pearson correlation coefficient formula and explain each component. (3)
(b) Given daily returns: Instrument P: (%), Instrument Q: (%). Compute the correlation coefficient from scratch (means, deviations, covariance, std devs). (6)
(c) Explain out loud how a trader uses a high positive correlation between two watchlist stocks to avoid over-exposure. (3)
Question 5 — Screening Code From Memory (8 marks)
Write pseudocode (from memory) for a stock screener function that takes a list of stock dicts (each with avg_volume, atr_pct, rel_strength, price) and returns tradable candidates satisfying: liquidity (avg_volume > 1,000,000), sufficient volatility (atr_pct > 1.5), leadership (rel_strength > 1.0), and affordability (price < 3000). Sort output by rel_strength descending. (8)
Question 6 — Relative Strength & Sector Leaders (6 marks)
(a) Derive the relative strength ratio of a stock vs its benchmark and state what and a rising line mean. (3)
(b) Stock closes at (was ); benchmark at (was ). Compute the RS ratio of returns and interpret. (3)
Answer keyMark scheme & solutions
Question 1 (10)
(a) Buy at ask , sell at bid . Spread cost per round trip on a value of . Brokerage charged both sides . Round-trip cost fraction:
- = spread as fraction of mid (implicit cost). (2)
- = explicit brokerage both legs. (2)
(b) Stock A: , . (2) Stock B: , . (2)
(c) Choose the lower-cost, tighter-spread stock (B) for scalping since frequent trades make spread the dominant cost; edge per trade is small so cost must be minimized. (2)
Question 2 (12)
(a) Total free-float mcap . Raw sum changes with corporate actions, so we normalise by divisor : is set so the index equals a chosen base value at the base date; adjusting on splits/additions keeps the index continuous. (4)
(b) Current mcap . Index base : . (2) New mcap with X=550: . New index . (3)
(c) Bank Nifty has fewer constituents (~12) and heavy concentration in top private banks; large weighted names move it more, so idiosyncratic bank moves aren't diluted → higher volatility than the broader 50-stock Nifty. (3)
Question 3 (12)
(a) Long call payoff at expiry . Below lose premium ; above gains linearly. (2.5) Short put payoff . Keep premium above ; lose linearly below. (2.5)
(b) Long future payoff . Long put payoff . Combined:
- If : .
- If : . Max loss (floor). (5)
(c) This is a protective put (synthetic long call). View: bullish but wanting downside protection. (2)
Question 4 (12)
(a) ; numerator = covariance (co-movement), denominator = product of std devs (normalises to ). (3)
(b) , . Deviations P: ; Q: . Products: → . ; . . (6)
(c) Two highly correlated stocks are effectively one bet; taking full positions in both doubles risk without diversifying. Trader sizes them as one exposure or picks the stronger only. (3)
Question 5 (8)
def screen(stocks):
out = []
for s in stocks:
if (s['avg_volume'] > 1_000_000 and # liquidity (2)
s['atr_pct'] > 1.5 and # volatility (1)
s['rel_strength'] > 1.0 and # leadership (1)
s['price'] < 3000): # affordability(1)
out.append(s)
out.sort(key=lambda s: s['rel_strength'], reverse=True) # sort (2)
return out # return (1)Correct filter logic (5) + sort desc (2) + return (1).
Question 6 (6)
(a) (or ratio of normalised returns). (or rising) means the stock outperforms the benchmark → leadership. A rising RS line = accumulating relative strength. (3)
(b) Stock return , benchmark . RS of returns ; stock outperforms benchmark → relative leader. (3)
[
{"claim":"Round-trip cost Stock A = 2.06%","code":"s=4; M=200; b=0.0003; C=s/M+2*b; result=abs(C-0.0206)<1e-9"},
{"claim":"Round-trip cost Stock B = 0.56%","code":"s=1; M=200; b=0.0003; C=s/M+2*b; result=abs(C-0.0056)<1e-9"},
{"claim":"Index divisor 150 and new value 1033.33","code":"D=150000/1000; newidx=155000/D; result=(D==150) and abs(newidx-1033.3333333)<1e-3"},
{"claim":"Correlation PQ = 1.0","code":"P=[2,-1,3,0]; Q=[1,-2,2,-1]; mP=sum(P)/4; mQ=sum(Q)/4; cov=sum((p-mP)*(q-mQ) for p,q in zip(P,Q)); sp=sum((p-mP)**2 for p in P); sq=sum((q-mQ)**2 for q in Q); rho=cov/(sp*sq)**Rational(1,2); result=simplify(rho-1)==0"},
{"claim":"RS ratio of returns = 1.0909","code":"rs=Rational(120,100)/Rational(110,100); result=abs(float(rs)-1.0909090909)<1e-6"},
{"claim":"Protective put max loss = 150","code":"import numpy as np; loss=min((St-22000)+max(22000-St,0)-150 for St in range(20000,24001,50)); result=loss==-150"}
]