The Stochastic Oscillator compares where a security's price closed relative to its price range over a given time period. The Simple Stochastic Indicator (%K) is calculated using the following formula:
%K = 100 * (Today's close - LL) / (HH - LL)
LL is the current lowest low value for the given time period.
HH is the current highest high value for the given time period.
The Smoothed Stochastic Indicator (%D) is calculated as a Moving Average of %K. For example you can use the following expression:
SMA( STOCHASTIC(close; high; low; 10); 10 )