Calculating Stochastic K & D Values

I am calculating Stochastic %K and %D values but it does not match with Zerodha Chart value. Can you please suggest the exact input so that our calculation for %K and %D values.

I am using following input to calculate %K & %D values.

$high ==> array of high values ,
$low ==> array of low values,
$close ===> array of close values ,
Time period for building the Fast-K line ===> 14
Smoothing for making the Slow-K line ===> 3
Type of Moving Average for Slow-K ==> "SMA"
Smoothing for making the Slow-D line ==> 14
Type of Moving Average for Slow-D ===> "SMA"

Can you please suggest exact inputs which matches ZERODHA chart value with respect to the attach screen?

Sign In or Register to comment.