Logic is given below in steps:

1. calculate average of high, low, close - say A

2. calculate EMA of A for a period of 10 - say B

3. calculate absolute value of (A-B) - say C

4. calculate EMA of C for a period of 10 - say D

5. calculate C/(D*0.1) - say E

6. calculate EMA of E for a period of 21 - say T1

7. calculate SMA of T1 for a period of 4 - say T2

​Buy when T1 crosses T2 OR the moment when (T1-T2) becomes positive

Sell when T2 crosses T1 OR the moment when (T1-T2) becomes negative

AS PER ABOVE CONDITION

```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 T1-T2
```

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 T2-T1
```

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.

Awaiting revert. Thanks…