Pine Script (TradingView)
Ceci est un exemple Pine Script TradingView pour cet indicateur. Collez-le dans l'editeur Pine TradingView, ajoutez-le au graphique, puis ajustez les parametres selon votre marche et votre unite de temps.
//@version=6
strategy("Stochastic Oscillator", overlay=true)
length = input.int(14, "Length")
smooth = input.int(3, "Smoothing")
k = ta.sma(ta.stoch(close, high, low, length), smooth)
d = ta.sma(k, smooth)
longSignal = ta.crossover(k, d) and k < 25
exitSignal = ta.crossunder(k, d) and k > 75
if longSignal
strategy.entry("Long", strategy.long)
if exitSignal
strategy.close("Long")
plot(k, "K", color=color.aqua)
plot(d, "D", color=color.fuchsia)