TS8 Radarscreen Pennant Brkout UP

Can some one please post the code for this [Pennant Brkout UP] indicator for Radarscreen. I am running TS2000i so an ELD won't cut it - need it in text form so I can cut and past into PowerEditor and make any changes necessary to convert to TS2000i. It's supposed to be posted on the forum but in ELD format and I could not find it.

Aw, c'mon, someone must have it. Just a quick copy and paste would really help me.

WRT to intellectual property, as far as I am aware this indicator is based on the code in an article on scanning for pennants by Marcos Katsanos in TASC. He provided the Metastock code and in other articles of his TS provided the TS code, but with this particular one for some reason did not (missed deadline?).

{
Grid indicator. Apply to intraday data.
This indicator will trigger an alert, in real time, at the bar that makes the first
upside breakout from the pennant if a downside breakout does not occur first.
INDICATOR PLOTS
Column1 - HiLine: Starting with the bar that a pennant is confirmed on, and
continuing for a total of up to BarsPast bars, this column displays the value of the
high-line of the pennant at that bar. This value is updated at each bar of the
BarsPast period as the high-line is extended to the right, and sets the trigger for
the Pennant Brkout Up alert for the next bar. Starting with the bar after an alert
is triggered, Column1 switches to a display of the number of bars that have elapsed
since the alert, with a negative sign. This second display continues until
ColorBars bars have elapsed, at which time (or at the end of BarsPast bars if there
was no alert) the display turns blank again until the next pennant is identified.
For more information on how this indicator works, please refer to the in-line
documentation included in the companion ShowMe "Pennant Brkout".
}
inputs:
Length( 7 ), { number of bars in pennant }
MaxConsolIndex( 1.5 ), { enter a value in the 1-to-Length range; the lower this
value, the tighter the consolidation pattern }
BarsPast( 5 ), { the indicator will look for a pennant breakout for this many
bars after the pennant is identified }
AlertFGColor( Black ),
AlertBGColor( Yellow ),
PlotBars( 5 ), { number of bars on which to display a value in cell once pennant
is confirmed }
ColorBars( 5 ) ; { number of bars the alert colors will persist; set to 0 for no
cell alert coloring }
variables:
oTLHiStartPr( 0 ),
oTLHiEndPr( 0 ),
oTLLoStartPr( 0 ),
oTLLoEndPr( 0 ),
BarNum( 0 ),
AlertBarNum( 0 ),
BarsSinceAlert( 0 ),
PlotThisBar( false ),
ColorThisBar( false ) ;
Value1 = Pennant( Length, MaxConsolIndex, BarsPast, oTLHiStartPr, oTLHiEndPr,
oTLLoStartPr, oTLLoEndPr ) ;
BarNum = BarNumber ;
if Value1 = 2 then
begin
Alert( "Pennant brkout up" ) ;
AlertBarNum = BarNum ;
end ;
BarsSinceAlert = BarNum - AlertBarNum ;
PlotThisBar = AlertBarNum > 0 and BarsSinceAlert < PlotBars + 1 ;
ColorThisBar = ColorBars > 0 and BarsSinceAlert < ColorBars + 1 ;
if PlotThisBar and BarsSinceAlert > 0 then
begin
Plot1( -BarsSinceAlert, "HiLine" ) ;
if ColorThisBar then
begin
SetPlotColor( 1, AlertFGColor ) ;
SetPlotBGColor( 1, AlertBGColor ) ;
SetPlotColor( 2, AlertFGColor ) ;
SetPlotBGColor( 2, AlertBGColor ) ;
end ;
end
else if oTLHiEndPr > 0 then
begin
Plot1( oTLHiEndPr, "HiLine" ) ;
if ColorThisBar then
begin
SetPlotColor( 1, AlertFGColor ) ;
SetPlotBGColor( 1, AlertBGColor ) ;
SetPlotColor( 2, AlertFGColor ) ;
SetPlotBGColor( 2, AlertBGColor ) ;
end ;
end ;

I think the function code is in a function called pennant - just tried to verify Nana's code and 'pennant' in the body of Nana's code was flagged as not recognised by easylanguage - suggesting it is a missing function.

For the purposes of this study, a pennant is defined as a converging consolidation pattern on a bar chart. This includes cases where the two straight lines bounding the pattern's highs and lows are sloping in opposite directions as well as in the same direction, as long as they are converging. The limiting case of when the two lines are parallel is included. Note that this definition automatically includes certain consolidation patterns that may otherwise be known as "flags".

Algorithm

Check if the Consolidation Index (True Price Channel/Average True Range) is low enough (i.e., < MaxConsolIndex) to indicate a significant degree of price consolidation. ConsolIndex values can range between 1 and Length. Low values indicate price consolidation, high values indicate price extension. To identify reasonable consolidation patterns, some suitable combinations of Length/ MaxConsolIndex could be 7/1.5 and 15/2. (Also see the RS_PriceExtension function, which looks for high values of ConsolIndex.)

If price consolidation is confirmed, outline the pattern by "drawing" a linear regression line through the pattern's highs and a second such line through the pattern's lows, and check if the lines are converging.

If the lines are converging, a pennant exists; finish defining the pennant by shifting the lines outwards as much as necessary to fully enclose all the bars in the consolidation pattern.

For the next BarsPast bars, or until the pennant converges, whichever comes first, look for the price to breakout of the pennant, up or down, whichever comes first. (Simultaneous up and down breakouts are ignored.)