예제 #1
0
def test_ao():
    """test TA.AO"""

    ao = TA.AO(ohlc)

    assert isinstance(ao, series.Series)
    assert ao.values[-1] == -957.63459032713035
예제 #2
0
def test_ao():
    """test TA.AO"""

    ao = TA.AO(ohlc).round(decimals=8)

    assert isinstance(ao, series.Series)
    assert ao.values[-1] == -957.63459033
예제 #3
0
    def get_ao(data):
        """Calculate the awesome oscillator of given dataframe.

        :param data: a dataframe in OHLC format
        :return: a Pandas series
        """
        if data is None:
            raise EmptyDataError("[!] Invalid data value")

        result = TA.AO(data)
        if result is None:
            raise IndicatorException
        return result
    # Assesses price direction and strength - Allows the trader to differentiate between strong and weak trends
    prices["DMI_plus"], prices["DMI_minus"] = TA.DMI(ohlc)

    # Trend strength - below 20 is weak, above 40 is strong and above 50 is extremely strong
    prices["Trend_strength"] = TA.ADX(ohlc)

    # Stochastic oscillator
    prices["STOCH"] = TA.STOCH(ohlc)
    prices["STOCHD"] = TA.STOCHD(ohlc)
    prices["STOCHRSI"] = TA.STOCHRSI(ohlc)

    # Williams %R is a technical analysis oscillator
    prices["WR"] = TA.WILLIAMS(ohlc)

    # Awesome Oscillator - measures market momentum
    prices["awesome_oscil"] = TA.AO(ohlc)
    prices["ultimate_oscil"] = TA.UO(ohlc)

    # Mass index - measures high-low range expansion to identify trend reversals. Essentially volatility indicator
    prices["MI"] = TA.MI(ohlc)

    # Balance of power indicator
    prices["BOP"] = TA.BOP(ohlc)

    # Vortex indicator is two oscillating lines one for positive trend movement and one for negative trend movment
    prices["VIm"], prices["VIp"] = TA.VORTEX(ohlc)

    # Know sure thing momentum oscillator
    prices["KST_k"], prices["KST_signal"] = TA.KST(ohlc)

    # True strength index momentum oscillator