I've spent time searching pages of backtested EAs looking for EMAs, and all I could find were crosses of EMAs etc.

I've tried writing my own to buy/sell AT an EMA, but it won't let the SL/TP play out on the backtesting. It will close the open position, and re-open again if it hits the EMA again .

Could anyone point me to an EA that does this already, or could tell me what I might be doing wrong or suggest a solution?

best regards.