EMA cross over of price

Hi guys any one please help me I need AFL price should cross 21 EMA and candle has to close above EMA and close is in between 0- 0.2% of 21 Ema price

What have you tried so far?

See How to ask a good question.

1 Like

@jyo, give this a look: AFL Cross() function.

@jyo this forum perhaps unlike other forums, is the official AmiBroker community forum. It's users, even "newbie" or "beginner" are expected to want to learn how to use AmiBroker. So it is rare that you will get any answer without at least showing some effort that you are actually trying to learn how to use the software.

Having written that, here is a simple attempt (could be coded in several different ways) to solve your question with the hope that other's will not post countless similar questions with a similar lack of effort.

ema21 = EMA(C, 21);
condition = Cross(Close, ema21) AND (Close < 1.002*ema21);

You will see Green Up Arrows at points that meet your condition with the light Orange line being the 21 day ema and the dashed Rose line being 0.2% above that ema.
image

5 Likes

sir please post total code for me

Seriously? have you not been reading the above responses?

3 Likes

@jyo,

This is not a free coding service forum!

2 Likes