Cycle
Cycle in ProBuilder extracts the cyclical component of a price series, oscillating around zero to highlight repetitive market rhythms. Syntax and examples.
Syntax
Cycle(price)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
price | price source | close | Series the cycle extraction is applied to, such as close, open, high, low, or a custom variable. |
There is no period parameter. The cycle length is determined internally by ProRealTime™.
Formula
ProRealTime™ does not publish a closed-form expression for this indicator. Conceptually, the function removes the trend component from the input series and returns the remaining oscillating component, so the output swings around a zero line. The exact detrending and smoothing method is internal to the platform and cannot be configured.
How it works
Market prices are often modelled as the sum of a trend, a cyclical component, and noise. Cycle isolates the middle part: the repeating swings that occur around the prevailing trend. The output is an unbounded oscillator centered on zero. When the cyclical component is above zero the series is in the upper half of its detected swing, when below zero it is in the lower half.
Because the calculation is fixed, the indicator is used more as a phase detector than as a tunable oscillator. Typical applications are timing entries inside an established trend, or flagging when a swing is likely stretched. Zero-line crossings mark the transition from one phase of the cycle to the other.
Cyclical analysis assumes the market actually oscillates. During strong one-directional trends the cyclical component becomes small relative to the trend, and its crossings carry less information. Pairing the oscillator with a trend filter, as in Example 3, is the common workaround.
Examples
Example 1, Bullish and bearish cycle phases (Indicator)
// Classify the current cycle phase from the sign of the output
c = Cycle(close)
IF c > 0 THEN
Bullish = 1
Bearish = 0
ELSE
Bullish = 0
Bearish = -1
ENDIF
RETURN Bullish coloured(0,128,0), Bearish coloured(255,20,147)Displays a green step line at 1 while the cyclical component is positive and a pink step line at -1 while it is negative, giving a quick visual phase map.
Example 2, Cycle turning up scan (ProScreener)
// List instruments whose cycle component just crossed above zero
c = Cycle(close)
SCREENER[c CROSSES OVER 0](c AS "Cycle")Returns instruments entering the positive phase of their cycle on the current bar, a starting list for swing entries.
Example 3, Cycle timing with a trend filter (ProBacktest)
// Buy cycle upturns only while price is above the long-term average
trend = Average[200](close)
c = Cycle(close)
IF NOT LongOnMarket AND close > trend AND c CROSSES OVER 0 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND c CROSSES UNDER 0 THEN
SELL AT MARKET
ENDIFThe 200-period average restricts trading to uptrends, and the zero-line crossings of the cyclical component time the entries and exits inside that trend.
Interpretation
- Above zero. The detected cycle is in its up phase. Rising values suggest the upswing is still developing, falling positive values suggest it is maturing.
- Below zero. The cycle is in its down phase, read symmetrically.
- Zero-line crossings. Mark phase transitions and are the most common trade trigger built on this indicator.
- Amplitude. The output is not bounded, so extreme values are relative to the instrument's own recent history rather than fixed thresholds.
The sign alone does not measure trend strength. Combine the oscillator with a directional filter for that.
Common errors and gotchas
- Adding a period in brackets.
Cycle[20](close)does not compile. The function takes only the price argument in parentheses and has no user-defined period. - No fixed overbought or oversold levels. Unlike RSI or Stochastic, the output is unbounded. Conditions like
Cycle(close) > 70are arbitrary; compare against zero or against the indicator's own recent extremes instead. - Weak signals in strong trends. When price trends hard in one direction, the cyclical component flattens and zero-line crossings turn into noise. Filter by trend direction before acting on crossings.
- Not a forecast. The function describes the current cyclical position of the series. It does not predict that the cycle will repeat with the same length or amplitude.
Related instructions
DPO, detrended price oscillator, another way to strip trend and expose cycles.TRIX, triple-smoothed momentum oscillator around a zero line.Stochastic, bounded oscillator locating the close within the recent range.RSI, bounded momentum oscillator with fixed thresholds.Momentum, raw N-bar price difference.ROC, rate of change in percent.Average, moving average, used as the trend filter in Example 3.
