Need help in afl code using condition and time dealy

#1
Hi I found 3 code which plots buy and sell. I want to automate so i need a solution to compare between the 3 afl and plot buy sell order . I would like to know whether there is a way to use 3 seperate charts and create conditon formating . if there is a way please let me know.
below is the code in which I want to compare if code1 and code2 or code3 generates signal at same time plot signal with a time dealy of 30 seconds and check within 3 candles for the condition . if signal generated in three code at same candle wait for 15 seconds. below is the final output of the 3 codes

a=C;
g=(EMA(Close,3) * (2 / 4 - 1)-EMA(Close,5) * (2 / 6 - 1)) / (2 /4- 2 /6);
e=Ref(tsl,-1);
Buy = Cross(C,tsl) ;
Sell = Cross(tsl,C) ;
SellPrice=ValueWhen(Sell,e,1);
BuyPrice=ValueWhen(Buy,e,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );
Filter=Buy OR Sell;
Buy = Cross(C,tsl) ;
Sell = Cross(tsl,C) ;



Plot(NW, "", IIf(Trend == 1, 27, 4), 4);
Buy=Cover=Cross(j,nw);
Sell=Short=Cross(nw,j);
SellPrice=ValueWhen(Sell,C,1);
BuyPrice=ValueWhen(Buy,C,1);
Long=Flip(Buy,Sell);
Shrt=Flip(Sell,Buy );



Buy=Cross(PPO,PPOS);
Sell=Cross(PPOS,PPO);
shape = Buy * shapeHollowUpArrow + Sell * shapeHollowDownArrow;
Buy=ExRem(Buy, Sell);
Sell=ExRem(Sell, Buy);



full code as been attached in this post
 

Attachments