StrategyCoder History

← Examples

Stochastic oscillator Experimental

Other platform v5/v6 → Cuprel · converter door 0.1.0 · converted · 11 lines out

Source (Other platform v5/v6)
//@version=5
indicator("Stochastic oscillator")
kLen = input.int(14, "K length")
dLen = input.int(3, "D smoothing")
k = 100 * (close - ta.lowest(low, kLen)) / (ta.highest(high, kLen) - ta.lowest(low, kLen))
plot(k, "K")
plot(ta.sma(k, dLen), "D")
Converted (Cuprel)
// converted by cuprel-convert 0.1.0 from a source written for another charting platform (format v5); original notices above unchanged

indicator "Stochastic oscillator"
    edition = 1

input kLen: int = 14, "K length"
input dLen: int = 3, "D smoothing"
let k = 100 * (close - tech.lowest(low, kLen)) / (tech.highest(high, kLen) - tech.lowest(low, kLen))
plot(k, "K")
plot(tech.sma(k, dLen), "D")
Experimental means: the converter reads a thin, tested slice, adds warnings, and says no when it is unsure. Run the converted program on your own data before relying on it.

Open in the converter Other platform v5/v6 → Cuprel route All examples