Indicators/probuilder · probacktest · proorder · proscreener

PRTBANDSMEDIUMTERM

PRTBANDSMEDIUMTERM in ProBuilder returns the medium-term line of the built-in PRT Bands, a dynamic support and resistance level. Syntax, examples and gotchas.

Syntax

probuilder
PRTBandsMediumTerm

The instruction takes no parameters and no price argument. It returns the current value of the medium-term PRT Bands line on the chart's instrument and timeframe.

Formula

PRT Bands is a proprietary built-in indicator of the ProRealTime™ platform and its calculation is not published. PRTBandsMediumTerm exposes the medium-term line of that structure as a numeric series. Its values cannot be reproduced from a documented equation, in contrast with channels such as Keltner or Donchian.

How it works

The PRT Bands indicator draws several lines around price: an upper band, a lower band, plus short-term and medium-term reference lines. PRTBandsMediumTerm retrieves the medium-term line, which tracks price on a slower horizon than the short-term line and is typically read as a medium-term support or resistance level.

A characteristic behaviour of this line is that it moves in steps. It can hold a constant value for several bars while price consolidates, then shift when the medium-term structure changes. That property makes conditions such as "flat for the last 5 bars, now turning up" meaningful, whereas they rarely trigger on continuously recalculated averages.

The series behaves like any other built-in indicator value. It can be assigned to a variable, offset with the [n] history operator, compared against price, and used in indicators, screeners and automated strategies. The companion instructions PRTBANDSUP, PRTBANDSDOWN and PRTBANDSSHORTTERM return the other lines of the same indicator.

Examples

Example 1, Flat-then-ascending band screener (ProScreener)

probuilder
a = PRTBandsmediumterm
// Band turning up after holding a constant value for the previous 5 bars
result = a > a[1] and summation[5](a = a[1])[1] = 5
screener[result]

Filters for instruments whose medium-term band has just started rising after staying unchanged for five consecutive bars, a transition from consolidation to a medium-term upmove.

Example 2, Medium-term line as chart overlay (Indicator)

probuilder
// Plot the medium-term PRT band with the close for context
band = PRTBandsMediumTerm
RETURN band AS "PRT medium-term band", close AS "Close"

Overlays the medium-term line on price. Sections where price holds above the line indicate a medium-term supportive regime, sections below indicate resistance overhead.

Example 3, Medium-term regime filter for entries (ProOrder)

probuilder
// Take breakout longs only while price holds above the medium-term band
band = PRTBandsMediumTerm
breakout = close CROSSES OVER highest[20](high)[1]

IF NOT OnMarket AND close > band AND breakout THEN
  BUY 1 CONTRACT AT MARKET
ENDIF
IF LongOnMarket AND close < band THEN
  SELL AT MARKET
ENDIF

Uses the medium-term band as a regime filter: 20-bar breakouts are only bought while price trades above the band, and the position is closed if price falls back below it.

Interpretation

SituationReading
Price above a rising bandMedium-term uptrend, band acting as support.
Price below a falling bandMedium-term downtrend, band acting as resistance.
Band flat for several barsMedium-term consolidation, no directional information.
Band turning up or down after a flat periodPossible start of a new medium-term phase.

The medium-term line is most informative in combination with the rest of the PRT Bands structure. Position within the channel, price relative to PRTBANDSUP and PRTBANDSDOWN, plus the direction of the medium-term line, together describe trend and location at a glance.

Common errors and gotchas

  • No parameters accepted. PRTBandsMediumTerm[50] or PRTBandsMediumTerm(close) will not compile. The horizon of the line is fixed inside the platform and cannot be tuned from code.
  • Proprietary formula. The line cannot be recalculated or validated externally. Strategies that need reproducible logic across platforms should rely on documented constructs such as moving averages or Donchian channels.
  • Flat stretches break naive comparisons. Because the line often repeats the same value, conditions like band > band[1] are false for long runs. Logic should treat equality as a distinct state, as the screener example does.
  • Equality tests inside summation. In summation[5](a = a[1]), the = acts as a comparison returning 1 or 0 per bar. Misreading it as an assignment is a common source of confusion when adapting this pattern.