GAP Up Intraday AFL - Adding Two Additional Conditions

Can someone please build two additional conditions in the below strategy. The below AFL is missing SL conditions , can someone add that please in the AFL. Also, if possible can u add exploration features to identify top 5 stocks from watchlist that are with highest volume and opened above Previous Day High and Top 5 stocks with Lowest volume opened below Previous Day Low. Thank you!

P.S - I have sourced this AFL from a public platform and I donot have any programming knowledge to build AFL , therefore requesting for Help.

Thanks,

GapUp and ORB :

Today's Open > Yesterday's High
And
Current High > Today's High (9.15-9.30 HIgh)
And
Current Close > Today's High (9.15-9.30 High)
Enter a Buy and Keep till 3.15 pm
Stoploss is 9.15- 9.30 Lowest Low
GapDown and ORB :

Today's Open < Yesterday's Low
And
Current Low < Today's Low (9.15-9.30 Low)
And
Current Close < Today's Low (9.15-9.30 Low)
Enter a sell and Keep till 3.15 pm
Stoploss is 9.15 - 9.30 Highest High

GAP UP & ORB AFL

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() );
_SECTION_END();
_SECTION_BEGIN("Magnified Market Price");
FS=Param("Font Size",27,11,100,1);
GfxSelectFont("Times New Roman", FS, 700, True );
GfxSetBkMode( colorWhite );
GfxSetTextColor( ParamColor("Color",colorGold) );
Hor=Param("Horizontal Position",1140,1,1200,1);
Ver=Param("Vertical Position",1,830,1);
GfxTextOut(""+C, Hor , Ver );
YC=TimeFrameGetPrice("C",inDaily,-1);
_SECTION_END();
Plot(V, "Volume", ColorRGB(27, 79, 114),styleHistogram|styleOwnScale|styleThick, 10);
grid_day = Month()!=Ref(Month(),-1);
Plot(grid_day,"",colorLightYellow,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
grid_day6 = Day()!=Ref(Day(),-1);
Plot(grid_day6,"",colorGrey50,styleHistogram|styleDashed|styleNoLabel|styleOwnScale);
H1 = Ref(H,-1);H2 = Ref(H,-2);H3 = Ref(H,-3);
L1 = Ref(L,-1);L2 = Ref(L,-2);L3 = Ref(L,-3);
C1 = Ref(C,-1); C2 = Ref(C,-2); C3 = Ref(C,-3);
O1 = Ref(O,-1); O2 = Ref(O,-2); O3 = Ref(O,-3);
BarsSinceOpen = BarsSince(Day() != Ref( Day(), -1 ));
DL = (LLV(L,BarsSince(BarsSinceOpen)));
DH = (HHV (H,BarsSince(BarsSinceOpen)));
PDH = TimeFrameGetPrice( "H", InDaily ,-1);
PDL = TimeFrameGetPrice( "L", inDaily,-1 );
TDO = TimeFrameGetPrice( "O", inDaily);
Plot(pdh,"",colorYellow,styleDashed,Null,Null,0,0,0.25);
Plot(pdl,"",colorYellow,styleDashed,Null,Null,0,0,0.25);
Cond_Gap = TDO > PDH OR TDO < PDL;
p=Param("Bar no",2,2,20,1);
BarsSinceOpen = BarsSince(Day() != Ref( Day(), -1 ));
Tt=(BarsSinceOpen == p);
fWHigh = ValueWhen(tt, HHV(H,3));
fWLow = ValueWhen(tt, LLV(L,3));
Plot(fWHigh,"\nHigh of "+(p-2)+" bar",5,24);
Plot(fWLow,"\nLow of "+(p-2)+" bar",4,24);
BuyR = Cond_Gap AND Cross(C,fWHigh) AND TimeNum() > 092900;
ShortR = Cond_Gap AND Cross (fWLow,C) AND TimeNum() > 092900;
dn = DateNum();
newDay = dn != Ref( dn,-1);
OneTrade = Flip(newDay, Ref(BuyR OR ShortR, -1));
Buy = BuyR AND oneTrade;
Short = ShortR AND OneTrade;
BuyPrice= ValueWhen(Buy,C);
ShortPrice = iIf(Short,C,Null);
ENTRY = IIf(Buy,BuyPrice,IIf(Short,ShortPrice,Null));
Stoploss = IIf(Buy,fWLow,IIf(Short,fWHigh,Null));
dist = 0.5ATR(10);
dist1 = 2
ATR(14);
for( i = 0; i < BarCount; i++ )
{
if ( Buy )
PlotText( "Buy", i , L[ i ] - dist1 , colorDarkGreen, colorYellow ) ;
if (Short )
PlotText( "Sell", i , H[ i ] + dist1 , colorRed, colorYellow );
}
for( i = 0; i < BarCount; i++ )
{
if( Buy ) PlotText( " " , i-1, c[ i ],colorGreen );
if( Short ) PlotText( " " , I-1, c[ i ], colorRed );
}
//Exploration//
Filter= Buy OR Short;
AddColumn( IIf( Buy, 66, 83 ), "Signal", formatChar );
AddColumn(ENTRY,"ENTRY AT",1.2);
AddColumn(stoploss,"STOPLOSS AT",1.2);
//Shapes
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorGreen, 0, L, Offset=-40);
PlotShapes(IIf(Buy, shapeSquare, shapeNone),colorLime, 0,L, Offset=-50);
PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L, Offset=-45);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorRed, 0, H, Offset=40);
PlotShapes(IIf(Short, shapeSquare, shapeNone),colorOrange, 0,H, Offset=50);
PlotShapes(IIf(Short, shapeDownArrow, shapeNone),colorWhite, 0,H, Offset=-45);

You need to use code tags

Thanks for you reply! Can you please suggest what tags I need to use, I cant find any with Code. Additionally can u please help in resolving my query , I saw you are a pro in AFL scripting

See here (How to use this site).

Thank you ! will keep it in mind from next post