Need code for the stocastic strategy!plz help

Dear TEAM,

NEEDED SCRIPT CODE FOR 2 STARTERGY,

     1)  Need a script of stochastic crossover ( period 12 / Weighted Moving Average).

OVERSOLD FOR BUY.
OVERBOUGHT FOR SELL

IT SHOULD BE ( period 12 / Weighted Moving Average).

THANKS,

For the above given condition

Buy Script:

SOPK(9, 3, 9, SIMPLE) >80 80 OR SOPD(9, 3, 9, SIMPLE) > 80

Sell Script:

SOPK(9, 3, 9, SIMPLE) < 20 80 OR SOPD(9, 3, 9, SIMPLE) < 20