Category: Indicator > Bands
The Price Channel indicator calculates the highest high and lowest low of the trailing number of bars specified by the input Length. Lines representing the trailing highs and the trailing lows are then plotted.
When a market moves above the upper band, it is a sign of market strength. Conversely, when a market moves below the lower band, it is a sign of market weakness. A sustained move above or below the channel lines may indicate a significant breakout.
Length - Number of bars of data to be included in calculation
Displace - Number of bars to displace the plot of the Price Channel
INPUTS: LENGTH(10), DISPLACE(0);
VARIABLES: TCHAN(0), BCHAN(0);
TCHAN = HIGHEST(HIGH, LENGTH);
BCHAN = LOWEST(LOW, LENGTH);
IF DISPLACE >= 0 OR CURRENTBAR > ABSVALUE(DISPLACE) THEN BEGIN
CONDITION1 = PLOT1 <> PLOT2;
IF CLOSE > PLOT1 AND CONDITION1 THEN
ALERT("PRICE HAS CLOSED OVER THE TOP BAND")
IF CLOSE < PLOT2 AND CONDITION1 THEN
ALERT("PRICE HAS CLOSED UNDER THE BOTTOM BAND");