How to take previous 52 Week high value

#1
Today (on 17th Nov) HITACHIHOM has touched new 52 W High (838). I want the previous 52W high value of the newly touched 52W High (prev high on 13th Nov - 721.90).

Steps that I will follow for this:
1) I will filter today's 52 Week High stock.
2) Then previous 52 W high scrips which are <=5% from current 52W high will have to get filtered and shown (for 20 days time period).

For eg (for 20 days time period):
Valid one (to be shown):
Today's 52W High: 100
Prev 52W High: 96 (4% away from current 52W high, hence ok)

Invalid one (not to be shown):
Today's 52W High: 100
Prev 52W High: 90 (10% away from current 52W high, hence NOT ok).

Your help is highly appreciated.
 
#2
hi check this afl
Code:
_SECTION_BEGIN("52 week high");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
High52 = Ref(HHV(High,365),-1);
Low52 = Ref(LLV(Low,365),-1);
Buy52 = Cross(Close,High52);
Sell52 = Cross(Low52,Close);
near52 = Close > (High52-(High52*0.05)) AND Close <High52;
near51 = Close < (Low52 +(Low52*0.05)) AND Close > Low52;
near = SelectedValue(near52);

Filter = near52 OR Buy52;
AddColumn(near,"near 52 high");
AddColumn(Buy52,"52 week high");
AddColumn(Close,"close");
AddColumn(Volume,"volume");
shapes = Buy52 * shapeUpArrow ;
PlotShapes(shapes,colorBlue);
Plot(High52,"52 week high",colorBlue,styleLine);

_SECTION_END();
 
#3
Thanks for your AFL.

But can I have a column added saying previous 52W high as so and so values.

I explored the given AFL, and seen that previous highs have been drawn. From the drawn lines, can I have the value of just the previous 52W high alone.