QM010 Hands-on Lab
Momentum and Trend Signals
Objective
Trace a simple 3-period momentum signal from prices to the next holding period and see how a skip-period convention changes the measured signal. The goal is timing discipline, not finding an optimal lookback.
Run
From the QM010 folder:
python labs/python/qm010_momentum_example.pyThe script prints the 3-period momentum with skip=0 and skip=1, then shows each signal date, the sign of the momentum signal, and the first holding period that can use that signal.
What to inspect
- Why do
m3_s0andm3_s1differ even though they use the same price history? - Does the position begin at the signal observation or at the next holding period?
- Which price would be unavailable if the holding return were accidentally aligned to the same period as the signal?
Experiment
Edit the prices sequence or change the lookback from 3 to 2 or 4. Then explain separately how the economic horizon and the signal-to-trade clock changed. Do not choose a lookback because it looks best on this toy path.
Interpretation boundary
The data are synthetic. The exercise demonstrates signal construction and timing conventions; it does not estimate the profitability of momentum or identify a preferred lookback.