Code for 17 EMA with ADX

I want the rfl code for the following.two conditions (each are separate strategies)

Also,I do not know how to insert this code and how to save this code permanently.

Also, how to find daily chart? I am getting only intraday chart.

I have to insert the codes for both intraday and daily charts.

First Strategy:

Use 5 min or 15 min time frame only. Buy if price comes from below the 17 period EMA and makes a higher swing above 17 period EMA. The 2 period ADX falls below 25 but price is still below 17 period EMA (signal bar). Place buy order one tick above the high of the signal bar. Cancel order if not triggered by the next bar. Put stop at the low of the signal bar and trail the stop. I have to backtest the strategy to know how much profit has been earned. The chart should display buy signal.

Indukala NV

_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() ); 
ema17 = EMA(Close,17);
prdhi17 = HHV(Close,17);
adxval = ADX(2);

buysig = Cross(ema17,close) AND (prdhi17 > ema17) AND (adxval < 25);
Buy = IIf(buysig, (Close > Ref(High,-1)),0);

PlotShapes(IIf(Buy, shapeUpArrow, shapeNone),colorWhite, 0,L); 



Could not find much trades with the strategy. Let me know if you need anything.



(Authorized vendor of NSE supporting realtime data feeds to Amibroker,Metastock and Ninjatrader)