GugoPro Academy← Back to investment topics index
Quantitative research · 15

Quant research workflow:
Put 5MA, volatility and backtests into the same chain of evidence.

Quantitative work isn't about making charts more complicated; it's about clearly documenting the research question, data scope, formulas, execution rules and failure conditions. This article uses 5MA/20MA offsets, volatility Z‑Score and out‑of‑sample backtesting to establish a reproducible process. Z-Score

Read the conclusion first.

1. First write the research question as a falsifiable proposition

1.1 Change “will it rise?” into observable conditions

“5MA up so it will rise” is not a complete proposition because it omits the signal timestamp, entry price, holding period, trading costs, and failure conditions. A more testable phrasing is: “When the 5‑day MA at close is above the 20‑day MA, hold one daily bar the next trading day; after deducting two‑way costs, is the average return still positive?” That clarifies which fields to collect.

1.2 Fixed data scope

Before research, record the instrument, exchange, currency, adjustment method, frequency and cutoff date. If using ETFs, whether dividends are reinvested changes results; if using futures, the roll method for continuous contracts changes returns. Different measurement bases must not be silently mixed on the same curve. ETF

2. 5MA/20MA offset: understand the window first, then discuss turning points

2.1 Moving averages and deduction formulas

An n‑day simple moving average is the mean of the most recent n closes. Between today and tomorrow the window drops the oldest price and adds the new one, so the moving average can change for reasons other than today's return.

MA(n,t) = (C_t + C_{t-1} + … + C_{t-n+1}) / n
MA(n,t+1) − MA(n,t) = (C_{t+1} − C_{t-n+1}) / n

2.2 Reproducible demonstration

Example numbers (not market quotes):Assume the oldest value of the 5‑MA today is 100 and tomorrow’s new close is 105; the MA moves up mechanically by (105−100)÷5 = 1 point. If the new close is 98, the change is (98−100)÷5 = −0.4 points. That difference is a mechanical calculation, not a trend prediction.

2.3 Usage boundaries for 5MA and 20MA

Short moving averages are sensitive to noise, long moving averages are slow to react to turns. When comparing offset values, also observe volume, volatility state, support/resistance and transaction costs; do not present “higher offset → aids decline, lower offset → aids rise” as deterministic causation. Can directly useVolatility Z‑Score tool Z-ScoreCheck the volatility environment at the time, then reconcile historical close prices in your own spreadsheet.

3. Volatility Z‑Score: clearly define high vs low volatility Z-Score

3.1 From price to returns

Calculate daily returns first using prices adjusted to the same adjustment convention. r_t=P_t/P_{t-1}−1,then compute the sample standard deviation over a fixed window. If you use prices directly to compute standard deviation, you will mistake price level for risk.

σ_t = √[Σ(r_i − r̄)^2 / (w−1)]
Z_t = (σ_t − mean(σ)) / stdev(σ)

3.2 Interpreting three situations

resultWhat may be saidThings you shouldn't say
Z ≥ 2Current rolling volatility is high relative to the sample's own distributionCannot directly tell you to short or that something will definitely fall
−2 < Z < 2Approaching the midpoint of its own sampleDo not say the risk has disappeared
Z ≤ −2Current volatility is low relative to its own distributionDo not say low volatility equals safety

Window, sample length and market structure all affect the Z‑Score. It is suitable for research stratification — e.g., adjusting backtest cost assumptions or shortening leveraged exposure — not as a substitute for a trading plan. Z-Score

4. Out‑of‑sample backtest: prevent mistaking historical noise for edge

4.1 Slice by lookahead time, then retune parameters

Split data into research, validation and archived out‑of‑sample periods. Parameters may only be set in the research period; out‑of‑sample data may only be used after rules are locked. If you repeatedly view out‑of‑sample results and then change parameters, it is no longer out‑of‑sample.

4.2 Next‑bar execution and costs

Signals formed at the close cannot assume execution at that same closing trade, unless you can prove a close‑matching mechanism. A conservative approach is to execute on the next bar and include commissions, spreads, slippage, taxes, rollovers and suspensions. Strategy returns and buy‑and‑hold should be compared using the same price basis.

4.3 Drawdown is not a cosmetic metric

Beyond total return, you should at least report maximum drawdown, drawdown duration, number of trades, single‑trade distribution, worst consecutive losses and out‑of‑sample deviation. Achieving a high Sharpe on a small number of trades may be estimation error; using many parameters to make a curve look straight risks overfitting.

Can be paired withHistorical VaR estimatorKelly risk budget tool,turn research results into stress tests rather than directly into position sizing.

5. Reproducible quantitative research checklist

Practice desk

Turn the research process into operational calculations.

Paste in your verified daily returns first, use the Z‑Score to check volatility positioning, and finally use risk budgeting to check position limits. Z-Score

Open research tools →

Common questions

Does a higher offset value necessarily contribute to price declines?

No. The offset value only describes the mechanical effect of replacing the moving‑average window; actual prices remain affected by new information, volume, liquidity and market microstructure.

Can the Z‑Score predict crashes? Z-Score

No. It is a descriptive statistic of the relative distribution; even with a high volatility Z‑Score, it provides no information on direction or timing. Z-Score

Does poor out‑of‑sample performance necessarily mean the strategy is invalid?

It at least indicates that the current rules and data scope did not reproduce an edge during the out‑of‑sample period. You should first check data, cost and execution assumptions before deciding to stop research, rather than retroactively tweaking out‑of‑sample parameters.

Financial risk disclaimer

This page, its calculators, and examples are for education, research, and scenario estimation only. They are not personalized investment, trading, betting, tax, legal, or financial advice. Markets and local rules can change quickly; verify current primary information and take responsibility for your decisions. Past performance, model outputs, and simulations do not guarantee future results.