ACOscillator.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:AutoTrading 作者: curme 项目源码 文件源码
def ACO(self, df):
        """
        Helper indicator
        :param df:
        :return:
        """
        df_mid_points = (df['High'] + df['Low']) / 2
        mid_points = Data.toFloatArray(df_mid_points)
        longav = tl.SMA(np.array(mid_points), timeperiod=40)
        shortav = tl.SMA(np.array(mid_points), timeperiod=15)
        A0 = longav - shortav
        Mavg = tl.SMA(A0, timeperiod=15)
        AcResult = tl.SMA(Mavg - A0, timeperiod=15)
        signals = np.diff(AcResult)
        return signals

        # if __name__ == "__main__":
        #     np.set_printoptions(threshold=np.nan)
        #     pd.set_option("display.max_rows", 280)
        #     dt = Data()
        #     df = dt.getCSVData()
        #     #ACOscillator(df)
        #     ACOscillator(df)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号