(df, n)
return out(SETTINGS, df, result)
Stochastic oscillator %D
Stochastic oscillator %D
Stochastic oscillator %D
def STO(df, n):
    """
    Stochastic oscillator %D
    """
    SOk = pd.Series((df['Close'] - df['Low']) / (df['High'] - df['Low']), name='SO%k')
    result = pd.Series(SOk.ewm(span=n, min_periods=n - 1).mean(), name='SO%d_' + str(n))
    return out(SETTINGS, df, result)
def STO ( df , n ) : SOk = pd . Series ( ( df [ 'Close' ] - df [ 'Low' ] ) / ( df [ 'High' ] - df [ 'Low' ] ) , name = 'SO%k' ) result = pd . Series ( SOk . ewm ( span = n , min_periods = n - 1 ) . mean ( ) , name = 'SO%d_' + str ( n ) ) return out ( SETTINGS , df , result )