"priceClose(1) < upper && priceClose(0) > upper" is identical to a crossover, but "priceClose(1) > down && priceClose(0) > down" is not.

- tmp is not a line of GMACD. Why do you filter the signal with it? What is tmp supposed to be?

- And where is the SL?