The Stochastic Oscillator compares a closing price to a range of its prices over a given period. It consists of the %K line and the %D signal line.
//@version=6
indicator('Stochastic', overlay=false)
periodK = input.int(14, '%K Length')
periodD = input.int(3, '%D Smoothing')
smoothK = input.int(3, '%K Smoothing')
k = ta.sma(ta.stoch(close, high, low, periodK), smoothK)
d = ta.sma(k, periodD)
plot(k, '%K', color=color.blue)
plot(d, '%D', color=color.orange)Enhance your trading workflow with these professional tools and platforms.
Keep 100% of the first $12.5K. EOD Drawdown and flexible evaluation types to suit your style.
Secure, reliable, and fully licensed. The best crypto experience for US traders.
The professional's choice for futures trading with minimal slippage and stable API.
Mirror the positions of top-tier traders instantly without writing code.