How Can we Combain with EMA 3,13,39 and ADX?

~~Dear Sir
Plz make a stategy for algoz
my stategy is
Exponential MA (3,13,39)
ADX 14
For long
If EMA39 is Trending UP, EMA (3 &13) crossing up to the EMA 39 and adx above 22 buy signal
IF EMA (3& 13) crossing down Exit
For Short
If EMA39 is trend Down, EMA (3 &13) crossing down the EMA 39 and adx above 22 Sell signal
IF EMA (3& 13) crossing up Exit
Sir , Iam waiting for your reply

Hello you can only code some parts of your expression here is the code.

Buy:

SET A = EMA(CLOSE, 39)
SET B = EMA(CLOSE, 3)
CROSSOVER( B, A) and ADX(14) > 22

Sell:

SET A = EMA(CLOSE, 39)
SET B = EMA(CLOSE, 3)
CROSSOVER( A, B) and ADX(14) > 22

Buy Exit:

SET A = EMA(CLOSE, 39)
SET B = EMA(CLOSE, 3)
CROSSOVER( A, B)

Sell Exit:

SET A = EMA(CLOSE, 39)
SET B = EMA(CLOSE, 3)
CROSSOVER( B, A)

NOT WORKING ON MY PI

For BUY, you want crossover b/w 3EMA& 13 EMA to happen first and then cross UP trending 39EMA?. or it doesnt matter when (3,13) meets (39)?

Hello do you mean each of the ema 3 and ema 13 should crossover with ema 39 from down. moving up for buy and the opposite for sell. Could you please expand on it.