Strategy #0000000024 · Statistical learning and prediction
Single-stock k-nearest-neighbour signal
Change neighbour returns and threshold to inspect an illustrative mean signal after costs.
Single-stock k-nearest-neighbour signal converts defined inputs into a rule or allocation. Its scenario illustrates the arithmetic, not validated excess returns.
An instructional feature-distance example; neighbour returns are not a reliable forecast.
Three ways in
Understand the story. Then inspect the risk.
Start with a familiar situation, check the payoff, then test how the numbers change.
The idea · in two minutes
Single-stock k-nearest-neighbour signal
Rose standardises completed-session returns, volatility and volume using only the training window. She finds the k historical states nearest to today’s feature vector and examines their subsequent returns.
Jack notices that future fields, full-sample scaling or data known only after the close can make neighbours look implausibly accurate. They fix the rolling window, distance metric, k, threshold and next tradable price.
Neighbour averages are sensitive to k, scaling, regimes and outliers. The model needs simple baselines, costs and strictly time-ordered out-of-sample testing.
- Neighbour 1Neighbour 1: assumed scenario 1.2; no historical observation is implied.
- Neighbour meanNeighbour mean: assumed scenario 0.47; no historical observation is implied.
- Illustrative net after threshold/costIllustrative net after threshold/cost: assumed scenario 0.37; no historical observation is implied.
Illustrative research examples only. They are not live signals or a recommendation.
The mechanics · payoff and exposure
Change neighbour returns and threshold to inspect an illustrative mean signal after costs.
x_t is a standardised feature vector known at t, such as lagged returns, volatility and volume. N_k contains the k nearest historical states; w_i are weights and c is the trading threshold. Features must be available at signal time.
Greeks: the directional intuition
- Input quality
- Measures sensitivity to implied volatility.
- Constraints
- Measures sensitivity to implied volatility.
- Execution
- Measures sensitivity to implied volatility.
- Validation
- Measures sensitivity to implied volatility.
Change neighbour returns and threshold to inspect an illustrative mean signal after costs.
Practical context · published observations
Single-stock k-nearest-neighbour signal: read the record with its caveats.
The chart uses the published figures or explicitly labelled study inputs below. A historical index or model replay is not the same as an investor’s realised account return.
這不是載入真實歷史特徵的 KNN 預測或績效回測。實際研究須避免標準化洩漏、重疊標籤、資料探勘和存活偏誤,並使用點時資料及交易成本。 Source ↗ · Methodology ↗
Change assumptions and inspect the scenario
Inputs illustrate the strategy mechanics; they are not live quotes, forecasts or investment advice.
Variants · same family, different risk levers
Model settings and execution rules change the result.
These methods share a broad idea, but their estimates and trading assumptions are not interchangeable.
| Related strategy | Relationship | What changes | New cost or risk |
|---|---|---|---|
| Uniform kNN | Equal neighbour weights | Averages the k nearest forward labels. | Sensitive to outliers and the choice of k. |
| Distance-weighted kNN | Weighted neighbours | Gives closer feature states greater weight. | Distance scale and zero-distance handling matter. |
| Rolling-window kNN | Adaptive training window | Drops older observations as regimes change. | A shorter window reduces sample size. |
| Classification threshold | Directional label | Predicts up/down/flat classes rather than return magnitude. | Class imbalance and calibration affect decisions. |
This is not a KNN forecast or backtest on historical features. Research must prevent scaling leakage, overlapping labels, data mining and survivorship bias, using point-in-time data and costs.
Read beyond the summary
References
Primary sources and research used to describe the strategy and its limits.