Beginner Trading Tutorial | ProRealTime ProBuilder

A large candle is not always evidence of sustained movement. A simple way to establish a baseline is to measure the absolute difference between consecutive closing prices, then average those differences. This indicator separates the size of the latest completed move from the typical recent move, without attempting to predict direction. It is particularly useful as a first exercise in historical indexing and rolling calculations in ProBuilder.

What the indicator measures

For each completed bar, subtract the previous close from its close and take the absolute value. A rise of three points and a fall of three points both produce three. The rolling mean is the sum of the last N such observations divided by N. Unlike ATR, this calculation does not include intrabar highs and lows. It describes close-to-close movement rather than the full trading range. Both outputs use the instrument's price units.

Suppose seven successive closes are 100, 101, 104, 102, 106, 105 and 107. The six absolute changes are 1, 3, 2, 4, 1 and 2. At the fourth observation the three-bar mean is (3+2+4)/3 = 3. At the sixth it is (4+1+2)/3 = 2.3333. The latest move is 2, slightly below that baseline. These are hypothetical prices, not market performance data.

Confirmed Mean Absolute Close Change Indicator

Figure 1. Blue columns represent completed absolute changes; green points represent their three-observation mean. In the live indicator each observation appears on the following bar.

Native indicator source

// PatternSmart: confirmed mean absolute close change
// ProRealTime ProBuilder indicator
// N is the averaging period, fixed here for simplicity.
N = 3
// Use only completed candles.
IF BarIndex >= N + 1 THEN
    MoveSize = ABS(Close[1] - Close[2])
    MeanMove = 0
ELSE
    MoveSize = 0
    MeanMove = 0
ENDIF
// Compute the rolling mean directly to avoid warm-up zeros.
IF BarIndex >= N + 1 THEN
    MeanMove = 0
    FOR k = 1 TO N DO
        MeanMove = MeanMove + ABS(Close[k] - Close[k+1])
    NEXT
    MeanMove = MeanMove / N
ENDIF
RETURN MoveSize AS "Closed move", MeanMove AS "Mean move"

Implementation details

ProBuilder evaluates the indicator across the chart. Close[1] is the preceding bar's close and Close[2] is the close before that. The loop visits offsets 1 through N and accesses offset N+1 for the oldest comparison. The BarIndex guard prevents premature historical access. The initial zero outputs are warm-up placeholders and should not be interpreted as genuine quiet-market readings. The loop explicitly sums valid differences, so the first valid average does not contain placeholder zeros. N is fixed at three for a transparent example; edit it to a positive integer to experiment with other windows.

RETURN exposes two named series in a single indicator. The first responds immediately to the last completed movement, while the second smooths recent observations. Because both include the latest completed observation, the average is not an independent prior-only threshold. If you later want a surprise ratio against a baseline that excludes the newest observation, shift the averaging window back one more bar and adjust the history guard accordingly.

Closed-bar behavior and repainting

Neither output reads Close without an offset. Consequently, during ordinary updates to the forming bar, both outputs remain constant. A new value becomes available when the next bar begins. This deliberate delay avoids interpreting a temporary intrabar price as a final close. The plot belongs to the current chart bar even though its input belongs to earlier bars; do not shift the plot backward to make it appear available earlier. There is no future-data reference. Historical corrections, changes in chart aggregation, session settings or adjusted prices can still alter historical values.

Installation

Open a ProRealTime chart, enter the indicators management area, and create a new personal ProBuilder indicator. Paste the complete source, name it Confirmed Mean Close Change, and apply it in a separate pane. Choose contrasting colors for the two outputs. Menu names can differ by version. Start with ordinary time-based candles and enough history to see several valid observations. This source has been reviewed conceptually but has not been compiled or run in ProRealTime for this article.

Practical interpretation and testing

A series of rising mean values suggests that recent closing-price movement has increased. It does not establish a bullish or bearish trend. Compare the indicator with the price chart to determine whether movement is directional or alternating. A quiet reading can occur before a breakout, but it can also persist indefinitely. The indicator is a descriptive filter, not an entry signal.

Manually calculate the example above and compare the results with the platform's data cursor, allowing for the one-bar display delay. Check a flat sequence, which should produce zero after warm-up. Check alternating equal rises and falls, which should produce a constant positive mean despite little net progress. Watch a forming candle change price: the two outputs should remain unchanged until a new bar starts. Reload the chart and compare completed observations under identical settings. Try a longer N to see how isolated spikes affect the baseline for more bars.

Limitations and extensions

Price units differ between instruments, so raw readings are not directly comparable across markets. A percentage or tick-normalized version may help, but requires a clear denominator and handling of zero or unusual prices. Overnight gaps can dominate the mean, while large intrabar reversals can be invisible when closes are similar. A session-aware implementation could exclude overnight transitions, but would need to define how to treat the first bar of each session. Larger windows reduce responsiveness; smaller windows increase sensitivity to isolated observations. For a session-aware or normalized variant, explore our Custom ProRealTime indicator Development Services.

Risk disclosure: This educational indicator is not investment advice or a tested trading system. Trading involves risk of loss. Validate data, code and execution assumptions independently before using any derived signal.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.