Updated by request: this is a "Strategy" trading version of the "QQE Cross Indicator Alert v2.0 by JustUncleL" (which is mainly for Binary Options trading), the same BUY/SELL signals are used to generate trade entry and exit conditions. Thanks again to JayRogers for making the Strategy risk management easier to understand and implement.
In this update I have added "Take Profit" option and cleaned up the risk management code. Also changed the close BUY/SELL order if EMA20 direction changes rather the next BUY/SELL opposite signal, making the close earlier.
BE ADVISED TO USE AT YOUR OWN RISK, even though back testing has shown good results, I don't have any Forex trading account to forward test against. You need to perform these test yourself and get back to me if there is any issues.