Logic is given below in steps:

calculate average of high, low, close  say A

calculate EMA of A for a period of 10  say B

calculate absolute value of (AB)  say C

calculate EMA of C for a period of 10  say D

calculate C/(D*0.1)  say E

calculate EMA of E for a period of 21  say T1

calculate SMA of T1 for a period of 4  say T2
Buy when T1 crosses T2 OR the moment when (T1T2) becomes positive
Sell when T2 crosses T1 OR the moment when (T1T2) becomes negative
Thanks in advance.
AS PER ABOVE CONDITION
BUY:
SET A = AVG(CLOSE, 10) + AVG(HIGH, 10) + AVG(LOW, 10)
SET B = EMA(A, 10)
SET C = ABS(A  B)
SET D = EMA(C, 10)
SET E = C/(D*0.1)
SET T1 = EMA(E, 21)
SET T2 = SMA(T1, 4)
CROSSOVER(T1, T2) OR T1T2
SELL:
SET A = AVG(CLOSE, 10) + AVG(HIGH, 10) + AVG(LOW, 10)
SET B = EMA(A, 10)
SET C = ABS(A  B)
SET D = EMA(C, 10)
SET E = C/(D*0.1)
SET T1 = EMA(E, 21)
SET T2 = SMA(T1, 4)
CROSSOVER(T2, T1) OR T2T1
Are you saying to take avg on high,low,close separately?
Yes. Average to be taken for each day and then ema to be calculated of this average for 10 days…
hope this clears.