I’m trying to create a Stochastic Oscillator in Pine Script to understand how the %K and %D lines are calculated instead of simply using the built-in indicator.
I want to plot both lines and add the standard 80 and 20 levels so the overbought and oversold zones are easy to identify.
I’m also looking for a way to keep the settings configurable, such as the %K length, %D length, and smoothing.
Can anyone help me with the correct way to implement this in Pine Script?