LVG,
I found the way. Following will give Y axis bottom and top.
Miny = Status("axisminy");
Maxy = Status("axismaxy");
Now we have to locate round numbers within this. May be we can parameterize 10, 50 , 100.
By the way, the other AFL also draws lines for all previous days. It is part of "Essential Trader Tools.afl". I had made changes to it to show only one day since the chart looks messy in hourly time frame.
Now AFL with RNs working given below
--------------
_SECTION_BEGIN("PreDHLCDayHLRN");
x=LastVisibleValue(DateNum());
Hor0 = Param("Hor0",900,0,1368,1);
Ver0 = Param("Ver0",30,0,768,1);
Cond=BarsSince(DateNum()<x);
y=Ref(DateNum(),-Cond);
Cond1=BarsSince(DateNum()<LastValue(y));
z=Cond1-Cond;
Hi0=HHV(H,Cond);
Hi0bar=HHVBars(H,Cond);
x20=BarCount-LastValue(Cond);
x21=BarCount-1;
y20=LastVisibleValue(Hi0);
y21=y20;
Line2 = LineArray( x20, y20, x21, y21, 1 );
Plot( Line2, "day high line", colorOrange,styleThick|styleNoTitle);
Li0=LLV(L,Cond);
Li0bar=LLVBars(L,Cond);
x30=BarCount-LastValue(Cond);
x31=BarCount-1;
y30=LastVisibleValue(Li0);
y31=y30;
Line3 = LineArray( x30, y30, x31, y31, 1 );
Plot( Line3, "day low line", colorTurquoise,styleThick|styleNoTitle );
Hi=Ref(HHV(H,z),-Cond);
Hibar=Ref(HHVBars(H,z),-Cond)+Cond;
x0=BarCount-1-LastValue(Hibar);
x1=BarCount-1;
y0=LastValue(Hi);
y1=y0;
Line = LineArray( x0, y0, x1, y1, 1 );
Plot( Line, "high line", ParamColor("high line", colorGreen),styleThick|styleNoTitle );
pc=Ref(Close,-Cond);
x10=BarCount-1-LastValue(Cond);
x11=BarCount-1;
y10=LastValue(pc);
y11=y10;
Line1=LineArray( x10, y10, x11, y11, 1 );
Plot( Line1, "Close line", ParamColor("close line", colorWhite),styleThick|styleNoTitle );
Lo=Ref(LLV(L,z),-Cond);
Lobar=Ref(LLVBars(L,z),-Cond)+Cond;
x00=BarCount-1-LastValue(Lobar);
x01=BarCount-1;
y00=LastValue(Lo);
y01=y00;
Line11=LineArray(x00,y00,x01,y01,1);
Plot(Line11,"Low Line",ParamColor("Low line", colorBlue),styleThick|styleNoTitle);
yh = int(Max(y0,y20)/50)*50;
yl = int(Min(y00,y30)/50)*50;
i=yl;
while( i>= yl AND i<=yh )
{i1 = i;
Linex=LineArray(x0,i,x1,i1);
Plot(Linex,"",colorGold,styleThick|styleNoTitle);
i=i+50;
}
_SECTION_END();
--------------