TimeMatrix Features · Practical Tutorial

Spectrum: A Step-by-Step Tutorial

Find candidate cycles in loaded chart history, fit a combined wave, and evaluate a held-out sample against a trend baseline.

By TimeMatrix · Updated · Desktop walkthrough

Spectrum is a member workbench on the Chart page. It analyzes loaded history from the active chart. At least 64 usable bars are required; longer candidate periods need a larger training sample.

Step 1

Load the chart history you want to analyze

Open a Daily chart for AAPL and choose Spectrum after Cycles in the lower tabs. Confirm the active chart symbol and timeframe before calculating. Use Expand for a larger view if needed.

The workbench takes a frozen snapshot of loaded chart history when you calculate. Panning the visible chart is not a date-range selection for Spectrum. Load more history first if you need a longer sample.

Replay does not truncate this sample at the replay boundary. Do not use Spectrum alongside replay as though it only knew the candles visible at that historical moment.

Step 2

Start with one consistent setup

Select Reset defaults, then check the following settings. History bars is a requested maximum; the actual usable count depends on what the chart has loaded.

  1. History bars: 1024; Price source: Close.
  2. Detrend: Remove linear trend; Window: Hann.
  3. Shortest cycle (bars): 4; Longest cycle (bars): 256.
  4. Holdout: Last 20%. Leave Include latest bar unchecked to avoid a potentially incomplete candle.
  5. Select Calculate and read the status line for the actual sample and permitted range.

Step 3

Read candidate periods and relative power

The spectrum plot and peak table describe repeating components in the processed sample. Periods are observed bars. On a Daily stock chart, a 20-bar period spans about 20 trading sessions, not necessarily 20 calendar days.

Power is normalized to the strongest displayed spectral peak. A reading of 100% means that peak is the reference maximum; it is not 100% confidence, a win rate, or a probability of reversal.

Review Observed cycles alongside period. A long period represented only a few times is harder to assess. The tool caps the longest tested period at one third of the training sample; a requested 256 bars can therefore be reduced when less history is available.

  1. Select a peak from the plot or table.
  2. Record its period and the actual training range.
  3. Start with one component before adding a second; do not simply select every prominent peak.
Spectrum plot, peak table, selected cycle and holdout metrics using illustrative data
Illustrative data in the current Spectrum interface. The sample contains constructed 32-bar and 80-bar components to make the peaks easy to identify. These are not AAPL market results. Select the image to view it at full size.

Step 4

Fit a combined wave

The selected-cycle controls show each component’s period, amplitude, phase, and weight. Each cycle also has a phase shift, up to twelve harmonics, and a memory window; memory 0 uses all training bars. You can select up to five cycles. Keep weight at 1 initially and Harmonics at Fundamental only.

Set Projection bars to 60 and use Fit cycles after editing the fit settings. Custom period (bars) lets you add a specific in-range period with Add cycle; record why you chose it before evaluating the outcome.

A simple conceptual example is one 20-bar component plus one 60-bar component. Their sum sometimes reinforces and sometimes cancels. It does not mean price must hit a particular level every 20 or 60 bars.

The wave initially shows deviation from the training trend. Use Show individual waves to inspect its components or Include training trend to restore the observed series scale. Add projection to chart creates an editable curve with chart Undo/Redo and saving.

Step 5

Compare the fit with its trend baseline

With Last 20% selected, the final fifth of the usable sample is held out of the training fit. Read training and holdout RMSE alongside their baseline values. RMSE measures the size of errors in the selected series units; lower is better for that sample.

Suppose an illustrative holdout RMSE is 1.8 while the baseline is 2.4. That fit has smaller errors than the baseline on that sample. A different holdout RMSE of 3.0 would be worse. These are arithmetic examples, not reported market performance.

Selecting periods, weights, or harmonics after seeing holdout results uses information from that holdout. Treat the result as exploratory and reserve another untouched period for evaluation. The tool is not an automated walk-forward strategy tester.

Step 6

Test successive windows and repeat a selected pattern

Run walk-forward validation rediscovers cycles at four successive points using only preceding bars, then measures each next unseen block. It tests automatic top-cycle discovery, not your manually selected combination, and leaves the final holdout separate. Compare its RMSE with the trend-only baseline.

The rolling spectrum shows six overlapping training windows. Inspect whether a period remains strong across windows; these historical bands do not establish how long a cycle will persist.

Open Repeat a selected wave, enter first and last training-bar numbers spanning one or two waves, and choose Fit selected pattern. Review the repeated harmonic shape and optionally Add pattern to chart. This is a shape-fitting tool, distinct from the walk-forward test.

Automatic cycles selects the top one to five peaks on Calculate. Optional new-bar refresh repeats this procedure as new loaded candles arrive; it reselects cycles and never loads extra history.

Step 7

Record the sample before leaving

Save the symbol, timeframe, actual sample dates and size, source, detrending, window, excluded latest-bar setting, holdout percentage, selected periods, weights, harmonics, and projection length in your notes.

Calculate refreshes the snapshot. Switching the chart scope, leaving the tab, or reloading clears the temporary analysis; the analysis controls are session-local. Export wave CSV or Export model and sample before leaving. Projections explicitly added to the chart remain ordinary saved drawings.

Next, compare calendar patterns with Market Cycles. Calendar-year comparisons and FFT periods answer different questions, so keep their units and samples explicit.

Common questions

Why is my requested longest period unavailable?

It must fit within one third of the training sample. Load more chart history, shorten the requested period, or review the holdout size.

Can I analyze returns instead of prices?

Yes. Price source includes Log returns (%). It requires positive prices and changes the series and interpretation; do not compare its RMSE directly with Close-price RMSE.

Why did my results disappear?

The analysis is temporary and belongs to the active chart scope. Changing symbol, timeframe, or chart window, leaving the tab, or reloading can clear it.