def SI(df, L, open='Open', high='High', low='Low', close='Close'):
    """
    Swing Index (J. Welles Wilder)
    Returns: list of floats = jhta.SI(df, L, open='Open', high='High', low='Low', close='Close')
    Source: book: New Concepts in Technical Trading Systems
    """
    si_list = []
    for i in range(len(df[close])):
        if i < 1:
            si = float('NaN')
        else:
            N = df[close][i] - df[close][i - 1] + 0.5 * (df[close][i] - df[
                open][i]) + 0.25 * (df[close][i - 1] - df[open][i - 1])
            R1 = df[high][i] - df[close][i - 1]
            R2 = df[low][i] - df[close][i - 1]
            R3 = df[high][i] - df[low][i]
            if R1 > R2 and R1 > R3:
                R = df[high][i] - df[close][i - 1] - 0.5 * (df[low][i] - df
                    [close][i - 1]) + 0.25 * (df[close][i - 1] - df[open][i -
                    1])
            if R2 > R1 and R2 > R3:
                R = df[low][i] - df[close][i - 1] - 0.5 * (df[high][i] - df
                    [close][i - 1]) + 0.25 * (df[close][i - 1] - df[open][i -
                    1])
            if R3 > R1 and R3 > R2:
                R = df[high][i] - df[low][i] + 0.25 * (df[close][i - 1] -
                    df[open][i - 1])
            K1 = df[high][i] - df[close][i - 1]
            K2 = df[low][i] - df[close][i - 1]
            if K1 > K2:
                K = K1
            else:
                K = K2
            si = 50 * (N / R) * (K / L)
        si_list.append(si)
    return si_list
