I will suggest to find some indicator that searches for the divergence and then to get the signals from that indicator in the EA and decide when to buy or sell