EMA >< a value alert

Hi Team,

Appreciate your assistance in this.

Please send me code for below condition.

Buy: if EMA20 > (EMA20 Value)

Sell: if EMA20 < (EMA20 Value)

Value means the changing value that changes as per hourly or daily chart.

For eg if Gold EMA20 for this hour is 25300 and if in next hour it is > 25400 then an alert should be generated as i put the code that alert if the Gold EMA20 is > 25400 and vice versa.

Hope i clarified here.

Thanks,

As per your condition

Buy Script:

EMA(CLOSE,20) > CLOSE

Sell Script:

EMA(CLOSE,20) < CLOSE

Thanks for the response.
So for Value i need to put that in place of “Close” price.
Means if i want to have alert >< at Gold at Rs 25400 then below will be applicable, correct?
BUY:
EMA(CLOSE,20) > 25400
Sell:
EMA(CLOSE,20) < 25400
Appreciate if you could please clarify.
Thanks in advance for your help.

here close in the sense close of the candle, (it automatically takes close value) if you want to define price specifically , you can use price alert indicator instead of this https://zerodha.com/expert-advisors/code/price-alert-indicator

Yes, but i am not interested in price. I am looking at the EMA Value that is there for EMA20, hope you are getting my point.
So i need code for that where EMA value can be taken for triggering alert and not the price.
Kindly assist and provide the appropriate code.
Thanks,

Hope you are now able to look into above request and condition. Kindly provide me with the appropriate code.
Appreciate your best coordination.

Buy Script:
EMA(CLOSE,20) > EMA(CLOSE,14)
Sell Script:
EMA(CLOSE,20) < EMA(CLOSE,14)
you can also use crossover for the above for exact break point( cross)

But i would prefer if Code is prepared using only one EMA, i do not need 2 EMA used here.
Can you please relook at this and send the code by using only one EMA?
Let me know if you need more clarification.
Thanks,

in condition any one ema should refer with any one atleast right. either with close or other ema. please verify your condition once, also check http://zerodha.com/varsity/module/technical-analysis/

let me understand this. If i need to compare EMA 20 value with EMA 20 value only every hour then below code will work? That was the original request by me. Let me know if this is possible at all?
Buy Script:
EMA(CLOSE,20) > EMA(CLOSE,20)
Sell Script:
EMA(CLOSE,20) < EMA(CLOSE,20)
or
Buy Script:
EMA(CLOSE,20) > EMA20 CLOSE
Sell Script:
EMA(CLOSE,20) < EMA20 CLOSE

how can be both with same parameters? please correct your condition.