2006issue C061-9
A linear-regression next-bar forecast needs a searchable cutoff
A three-bar linear regression of closes yields a next-bar forecast, but that residual becomes a mechanical rule only after it is scaled into alpha and compared with a cutoff. The archive supplies a default cutoff and then searches a small parameter-grid instead of treating the threshold as a fixed constant.
- A next-bar close forecast from a three-bar linear regression of closes becomes alpha when the residual versus the current close is divided by a seven-bar standard deviation of one-bar price changes, and only when that standard deviation is positive.
- The mechanical rule reads the previous bar’s alpha against a cutoff and the negative of that cutoff, then outputs a signal of +1, -1, or 0, staying flat in the open band.
- Chart, table, and strategy defaults use a three-bar forecast-length, a seven-bar standard-deviation-length, and a cutoff of 1.04, while a ten-step parameter-grid reports the best-cutoff by peak fractional-gain.
- A later rewrite keeps the same three-bar forecast and seven-bar deviation construction and exposes long and short coefficients as optimizable inputs over zero to 1 in steps of 0.1.
From a next-bar forecast to alpha
A next-bar close forecast is formed with a three-bar linear regression of closes. The residual versus the current close is then divided by a seven-bar standard deviation of one-bar price changes. That scaled score is alpha, and it is used only when the standard deviation is positive.
Forecast-length is the number of recent closes used to fit the linear regression that produces the next-bar price forecast. Standard-deviation-length is the lookback used to estimate a typical one-bar price change so the forecast residual can be expressed in volatility units.
A cutoff turns lagged alpha into a signal
The mechanical rule goes long when the previous bar’s alpha exceeds a cutoff, goes short when that lagged score falls below the negative of the cutoff, and stays flat otherwise. The integer rule output is the signal: +1, -1, or 0.
Default inputs supplied for the chart, table, and strategy implementations are a seven-bar standard-deviation-length, a three-bar forecast-length, and a cutoff of 1.04.
GM fractional gain at the default 1.04 cutoff

Forecast is a 3-bar linear regression of the close; omega is the 7-bar standard deviation of one-day price changes. The pane is labeled Trading System (1.04), the archive default cutoff. Intermediate points are approximate readings off the raster; the terminal 0.25 is also printed in the quote box.
Search the cutoff on a parameter-grid
A companion table implementation builds ten cutoffs from an initial value of 1.04 plus increments of 0.02. That set is the parameter-grid. On the last bar the table reports the best-cutoff, the grid member whose recorded peak fractional-gain path is highest.
On each bar with a non-zero signal and a positive prior close, the table adds the signed one-bar percentage change to that cutoff’s fractional-gain total and increments a win or loss count by the sign of that increment. Fractional-gain is the running sum of those signed one-bar percentage changes, taken only on bars where the rule is not flat.
Strategy form and a later coefficient rewrite
The strategy form enters long or short at the close when current alpha crosses the plus or minus cutoff, and flattens when alpha returns from beyond that cutoff into the open band between the two thresholds.
A later platform rewrite uses the same three-bar forecast and seven-bar deviation construction but exposes long and short coefficients as optimizable inputs over zero to 1 in steps of 0.1, or as fixed coefficients such as 0.6 on a daily Yahoo chart.
The procedure is presented as software implementations that turn a spreadsheet forecast-and-threshold idea into indicators, a tabular parameter comparison, and an optimizable mechanical system.
All readings on this track · 23 readings
- 1984Evaluating mechanical systems beyond net profit
- 1987Mechanical systems need more than pretty charts
- 1987Evaluating silver moving averages and RSI by scoring rule
- 1988Simple systems over optimized complexity
- 1988Cycle rule inputs until the parameter search stops
- 1990Split-sample tests for stochastic parameter grids
- 1993Four-subsystem trading system construction
- 1993Randomized price paths for stock system parameters
- 1994Mechanical timing with out-of-sample and filter checks
- 1995Evaluating asymmetric percent-reversal trading rules
- 1996Evaluating a daily volume-strength and new-high new-low timing procedure
- 1997Rule-based intraday system design with genetic search
- 1997Evolving three-rule systems with genetic templates
- 1997Audit the holdout and the exposure before the fitted entries
- 2001Inner weights are part of the candlestick signal
- 2003Mechanical short-term rules for news-sensitive rallies
- 2004Band construction as a testable trading procedure
- 2006Layered day-session automation from brackets to rules
- 2006Why mechanical rules must be retuned per security
- 2006A linear-regression next-bar forecast needs a searchable cutoff
- 2015Construct if-then rules, then backtest and optimize
- 2015Mechanical system design as a critique of discretion
- 2025Joint channel design with a trend filter and stop-loss orders