PLEASE HELP MODIFY BELOW AFL FOR BUY /SELL ARROWS, AS IT SHOWS MULTIPLE ARROWS

#1
_SECTION_BEGIN("YPF");
EntrySignal = C > ( LLV( L, 20 ) + 2 * ATR( 10 ) );
ExitSignal = C < ( HHV( H, 20 ) - 2 * ATR( 10 ) );
Color = IIf( EntrySignal, colorAqua, IIf( ExitSignal, colorOrange, colorGrey50 ));
TrailStop = HHV( C - 2 * ATR(10), 15 );
ProfitTaker = EMA( H, 13 ) + 2 * ATR(10);
/* plot price chart and stops */
Plot( C, "Price", Color, styleCandle | styleThick );
/* plot color ribbon */
Plot( 1, "", Color, styleArea | styleOwnScale | styleNoLabel, -0.1, 50 );
BanlanceSignal = ( LLV( L, 20 ) + 2 * ATR( 10 ) );
TYP=(High + Low + 2*Close)/4;
CI=(TYP-MA(TYP,14))/(0.015*StDev(TYP,14));
EM2=EMA(CI,5);

// Sigma
Var1=EMA((Close-Ref(Close,-5))/Ref(Close,-5),5);
Var2=EMA((Close-Ref(Close,-20))/Ref(Close,-20),3);
Var3=EMA((Close-Ref(Close,-30))/Ref(Close,-30),3);

G1= EMA(Var1,5);
G2= EMA(Var2,20);
G3= EMA(Var3,30);

Buy=EM2<-80 AND EM2>Ref(EM2,-1) AND Ref(EM2,-1)<=Ref(EM2,-2)AND G1>Ref(G1,-1);
PlotShapes( IIf( Buy, shapeDigit0, shapeNone ), colorBrightGreen ,layer = 0, yposition = C, offset = -20 );
Sell=IIf( EntrySignal, colorAqua, IIf( ExitSignal, colorOrange, colorGrey50 ));
_SECTION_END();

Buy=entrysignal;
Sell=exitsignal;
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
PlotShapes(shapeUpArrow * Buy,colorWhite,0,L,-15);
PlotShapes(shapeDownArrow * Sell,colorBlue,0,H,-15);
Plot(trailstop,"",colorLightGrey);
Plot(profittaker,"",colorRed);

_SECTION_BEGIN("Price1");
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();

// Downloaded From https://www.WiseStockTrader.com
_SECTION_BEGIN("HiLo modified");
K = Param("K",3,1,25,1,0);
per = Param("per",6,1,10,1);
filt = ATR(per)*k ;

Lo = 0;
Hi = H + 2*filt;

for(i = 2; i < BarCount; i ++)
{
if(i == 2) trend[1] = 1;


if(trend[i-1] == 1)
{
LoN = C - filt;
if(LoN > Lo[i-1])
{
Lo = LoN;
}
else
{
Lo = Lo[i-1];
}
if(L < Lo)
{
trend = 0;
Hi = L + filt;
}
else trend = 1;
}
if(trend[i-1] == 0)
{
HiN = C + filt;
if(HiN < Hi[i-1])
{
Hi = HiN;
}
else
{
Hi = Hi[i-1];
}
if(H > Hi)
{
trend = 1;
Lo = H - filt;
}
else trend = 0;
}
}

Hi = IIf(!trend, Hi, Null);
Lo = IIf(trend, Lo, Null);

UpDw=Flip( Hi, Lo );
Color = IIf(UpDw, colorYellow, colorBlue);

HiLoLine = IIf(UpDw, Hi, Lo);


Plot(HiLoLine, "Hi Lo Line", Color, styleStaircase);
_SECTION_END();
 

Broker Special Offers

Intraday Higher Leverage

Save up to 90% in brokerage and get higher leverage for intraday trades.

Name:Phone:
Email:City:
State:
Are you a day trader?