Your enter is K>D in the low band and close > last bar's high.
An has been added for targeting and stops.
You exit also in case of high values of K or in case D crosses over K but in the "upper".
Length, periods and level of bands are personalized.
The system goes long only, because it fits at best for shares only; I leave you the attemp of writing code for other classes and for going short, in particular.
Keep Oversold period high (> 20, also 40-45)
Keep Emaperiodfast higher (> 5)