Trading Dev AcademyFree quant education

Free lesson · Financial machine learning

From model forecasts to a constrained strategy

Open interactive lessonPractice calculationsExplore labs

Start with the idea

The decision layer combines opportunity, uncertainty, cost and existing positions. A model can add value by forecasting risk or execution cost even if it does not predict return direction.

Symbols, units & horizon
  • μ̂: predicted return over the decision horizon
  • σ̂²: predicted return variance over the same horizon
  • λ: positive utility/risk scaling
  • w*: unconstrained exposure
  • L: nonnegative absolute exposure cap
  • clip: enforce lower and upper bounds
  • J: one-period utility approximation, excluding turnover here

When and why to use this

Use a transparent allocator to test whether better ML forecasts improve net results without changing risk limits opportunistically.

Use a volatility or covariance model to scale exposure, a cost model to create a no-trade region and an alpha model to estimate conditional reward. Keep outputs in compatible units and horizons. A daily alpha divided by annual variance without conversion creates a sizing error.

A one-asset quadratic utility gives a transparent baseline for converting a forecast into exposure. In a real portfolio, cross-asset covariance, gross/net limits, liquidity, financing and current holdings require joint optimisation. Model uncertainty should reduce confidence in the forecast, not simply encourage leverage.

Construct a complete pipeline: causal data, training-only preprocessing, chronological out-of-fold predictions, calibrated decision rule, execution ledger and paired evaluation against an incumbent. Save the entire pipeline, not just a weights file. Monitor both forecast loss and realised net behaviour because either can deteriorate first.

J(w)=μ^w−λ2σ^2w2,w∗=μ^λσ^2,w=clip⁡(w∗,−L,L)
Model assumptions, derivation and arithmetic

From model forecasts to a constrained strategy

  1. Differentiate J in w to obtain μ̂−λσ̂²w.
  2. Set the derivative to zero and solve w*=μ̂/(λσ̂²). The negative second derivative establishes a maximum when variance and λ are positive.
  3. For a single symmetric bound, clip that optimum. With multiple assets or turnover costs, solve the constrained problem jointly rather than clipping independently.
Work it by hand

μ̂=.001, variance=.0004 and λ=10 give w*=.25. If the cap is .2, use .2. A lower forecast variance raises size, so underestimated risk can amplify losses.

Apply it in a strategy

  • Fit alpha, risk and cost components with aligned horizons and independent validation.
  • Generate out-of-fold positions under fixed caps and execution rules; compare with constant-risk baselines.
  • Deploy the versioned pipeline in shadow mode and monitor forecast drift, turnover, exposure and net results.

Research deliverable

Produce a complete component-level strategy diagram and an ablation table showing which learned input improves the final decision.

Research checkpoint · reviewed 11 September 2026

These sources inform the questions to test. A result is conditional on its data, simulator and evaluation design. The examples in this module are teaching calculations, not reproductions of the reported experiments.

Compare decision outcomes, not architecture names. This preprint benchmarks linear and deep sequence models on daily commodity, equity-index, bond and FX futures. Methods, cost treatment and seed-selection discussion were inspected in full text. Its headline horizon is labelled 2010–2025, while annual tables run 2010–2024. Primary optimisation/evaluation sets costs to zero; breakeven-cost analysis is separate. Validation selects seeds before ensembling. These choices motivate matched budgets, explicit net costs and cautious transfer of rankings; the experiments and code were not independently reproduced.

Further reading: Saly-Kaufmann et al. · Deep Learning for Financial Time Series · 2 March 2026 ↗

Research sources, review dates and limitations

Extend the research question

Compare an inexpensive baseline and a complex model under the same data, cost and search budget. Report forecast scores separately from downstream net utility.

Continue with the connected research module →

Connect the ideas: Information and decision time

Retrieve: Use only information available when the decision is made.

Check the change: Observation dates, release delays, revisions and label maturity require different availability checks.

Statistics → Research & backtests → Point-in-time data → Time series → Research & robust tuning → Putting it all together

Explain it yourself: Does shifting a feature by one row guarantee that it was available?

Self-assessed. Write your explanation before opening this comparison.

No. A revised value or delayed release may still contain unavailable information. Audit actual availability timestamps and fit preprocessing inside each training window.

Python implementation

Self-contained teaching example. Python 3.10+; dependencies and input conventions are shown in the code and notation. Run in your own Python environment.

def bounded_allocation(expected_return,variance,risk_aversion,limit):
    if variance<=0 or risk_aversion<=0 or limit<0: raise ValueError("Valid risk inputs required")
    raw=expected_return/(risk_aversion*variance)
    return raw,max(-limit,min(limit,raw))

print(bounded_allocation(.001,.0004,10,.2))

Continue learning

Machine Learning for Quantitative Strategy Development — all lessons
  1. Choose the model’s job: targets, horizons and decision layers
  2. Feature engineering, missingness and training-only transformations
  3. Regularised regression: an interpretable alpha baseline
  4. Logistic classification and cost-aware entry thresholds
  5. Trees and boosting: nonlinear interactions with controlled complexity
  6. Calibration, meta-labels and conditional payoff estimation
  7. Unsupervised learning, clusters and latent risk structure
  8. From model forecasts to a constrained strategy

Quantitative finance and development glossary · Python resources and libraries · Research sources and limitations