You can set the following variables for a % D Stochastic study:
%K Interval
The number of time periods used in the stochastic calculation.
%D Interval
The number of time periods used when calculating a moving average of %K.