Public test library / Backtest exercise 02
A signal qualifies, but the portfolio is full.
A and B already occupy both slots. C qualifies. A sells some shares. Does C have room to enter?
Trace cash and slots
Fictional simulation. Each supplied sale uses a $1 fee and the exercise makes proceeds available immediately.
Review this fictional portfolio-capacity exercise. Use only these inputs. The portfolio can hold at most two positions. It holds 10 shares of A and 5 shares of B with $200 in available cash. C qualifies as a candidate. It remains eligible throughout this exercise. First, four A shares sell at $50 per share with a $1 fee. At a later review, the remaining six A shares sell at $50 per share with another $1 fee. Each sale is a supplied simulated fill. For this exercise, the proceeds are immediately available. Any remaining positive holding occupies one slot. C has no supplied price or fill. For the initial state and each sale, show available cash, shares remaining, positions occupied, and whether C waits or can be considered. Reconcile both cash changes. Keep candidate eligibility, portfolio admission, and execution as separate steps. Leave C’s quantity and fill unknown.
Read the answer key
- Start with $200 and two occupied slots. C waits.
- The first sale adds $199. Cash rises to $399. A still holds six shares, so both slots are occupied and C waits.
- The second sale adds $299. Cash rises to $698. A has no shares left, so one slot opens and C can be considered. C’s quantity and fill remain unknown.
Exercise 02 · Version 1