Hi Ford Here is a code, well it may not be perfect . But in the absence of other better things,please try. If any error,please excuse. This I got from a friend,it is made him not me. ---------------- other afl experts please correct if you see any mistakes here in the code. thanks ------------------ afl code COCEPT:one month EMA CROSS 20 MONTH EMA
//CODE EMA1/EMA20 CROSSOVER SetChartBkColor(64); TimeFrameSet(inMonthly); /* MA now operates on MONTHLY data, maH_1 holds time-compressed 1 bar EMA of MONTHLY bars */ maM_1 = EMA( C, 1 ); maM_20 = EMA( C, 20 ); Buy = Cross( EMA( C, 1 ), EMA( C, 20 ) ); Sell = Cross( EMA( C, 20 ), EMA( C, 1 ) ); TimeFrameRestore(); Plot( Close, "Price", colorWhite, styleBar ); // plot expanded average Plot( TimeFrameExpand( maM_1, inMonthly), "1 bar moving average from MONTHLY bars", colorGreen ); Plot( TimeFrameExpand( maM_20, inMonthly), "20 bar moving average from MONTHLY bars", colorRed ); shape = Buy * shapeUpTriangle + Sell * shapeDownTriangle; PlotShapes( shape, IIf( Buy, colorBrightGreen, colorRed ), 0, IIf( Buy, Low, High ) ); ============================== ON A DAILY CHART THE EMA CROSS ARROWS ARE NOT COMING RIGHT BUY IF YOU CHOOSE MONTHLY CHART THE ARROWS BUY OR SELL COME OK try it cheers --- In amibroker@yahoogroups.com, "ford7k" <for...@...> wrote: > > > Hi afl experts > > please give me a afl code for plotting price,one month ema,20month ema > on a chart, with arrows.This forms basis to see major trend direction. > regards > ford >