Chandle
Chandle in ProBuilder returns the Chande Momentum Oscillator, a momentum indicator bounded between -100 and 100. Syntax, formula, examples, interpretation.
Syntax
Chandle[N](price)Parameters
| Name | Type | Default | Description |
|---|---|---|---|
N | integer | 14 | Lookback period in bars. Shorter periods react faster but produce more noise. |
price | price source | close | Series the oscillator is computed on, such as close, open, high, low, or a custom variable. |
Formula
pos = price - price[1] if price > price[1], else 0
neg = price[1] - price if price < price[1], else 0
Chandle = 100 * (Mpos - Mneg) / (Mpos + Mneg)
where Mpos and Mneg are the N-period averages of pos and negSince Mpos and Mneg are both non-negative, the numerator can never exceed the denominator in absolute value, which bounds the result between -100 and +100.
How it works
On every bar, ProBuilder splits each bar-to-bar change in price into a positive part and a negative part. The positive parts are averaged over N bars, the negative parts likewise, and the oscillator reports the normalised difference between the two averages.
The construction resembles RSI, and both indicators were designed to compress momentum into a fixed range. The key difference is the output scale: RSI maps the ratio of gains to losses into 0 to 100, while the Chande Momentum Oscillator reports the net balance directly in -100 to +100, so it is centered on zero. A reading of 0 means up moves and down moves cancelled out exactly over the window, positive readings mean buyers dominated, negative readings mean sellers dominated.
Because raw readings can be jumpy on short periods, a moving average is often applied to the oscillator output to filter one-bar spikes, as in Example 3.
Examples
Example 1, Averaging the oscillator of highs and lows (Indicator)
// 20-period Chande Momentum Oscillator on highs and on lows
Chandle1 = Chandle[20](High)
Chandle2 = Chandle[20](Low)
// Average the two series into a single line
Result = (Chandle1 + Chandle2) / 2
RETURN Result AS "Average Chandle"Computes the oscillator separately on the high and low series and returns the mean of the two, which dampens the effect of single-sided wicks.
Example 2, Oversold scan (ProScreener)
// List instruments with deeply negative momentum
cmo = Chandle[14](close)
SCREENER[cmo < -50](cmo AS "CMO 14")Returns every instrument whose 14-period reading is below -50, the conventional oversold threshold, sorted by the oscillator value.
Example 3, Smoothed zero-line strategy filter (ProOrder)
// Only allow long entries while smoothed momentum is positive
cmo = Chandle[14](close)
smoothCmo = Average[5](cmo)
IF NOT LongOnMarket AND smoothCmo CROSSES OVER 0 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND smoothCmo CROSSES UNDER 0 THEN
SELL AT MARKET
ENDIFA 5-period average of the oscillator drives entries and exits around the zero line, trading the shift between net positive and net negative momentum.
Interpretation
| Zone | Range | Reading |
|---|---|---|
| Oversold | below -50 | Down moves have dominated the window. Sometimes precedes a bounce, but can persist in downtrends. |
| Neutral | -50 to +50 | No decisive momentum. The zero line separates net buying from net selling pressure. |
| Overbought | above +50 | Up moves have dominated the window. Strong uptrends can hold this zone for extended stretches. |
Divergences between price and the oscillator, such as price making a lower low while the oscillator makes a higher low, are read the same way as RSI divergences: a possible weakening of the current move.
Common errors and gotchas
- Keyword spelling. The ProBuilder instruction is
Chandle, notChande,CMO, orChandeMomentum. Other spellings do not compile. - RSI thresholds do not transfer. RSI uses 30 and 70 on a 0 to 100 scale. This oscillator is centered on zero with -50 and +50 as the usual extremes. Reusing 30/70 levels produces conditions that are almost always true or almost always false.
- Bracket and parenthesis mix-ups. The period goes in square brackets and the price source in parentheses:
Chandle[20](close). WritingChandle(20, close)raises a syntax error. - Raw output is noisy. On short periods the line whips around zero. Smoothing with
Averagebefore testing crossings, as in Example 3, reduces signal churn considerably.
Related instructions
RSI, the closest relative, gain-to-loss ratio mapped into 0 to 100.ROC, rate of change, unbounded percentage momentum.Momentum, raw price difference over N bars.Stochastic, position of the close within the recent range.SMI, stochastic momentum index, a double-smoothed alternative.CCI, deviation-based oscillator with unbounded output.Average, moving average, used to smooth the oscillator output.DivergenceRSI, built-in divergence detection on RSI.
