示例#1
0
    def test():
        pl = publish.Publish()
        base_boll_up = get_boll_up_base()
        base_boll_lower = get_boll_lower_base()

        def get_data():
            code = jx.HCGD
            df = tdx.getFive(code)
            return df

        key = myredis.gen_keyname(__file__, Recognize_boll.test)
        df = myredis.createRedisVal(key, get_data).get()
        df = stock.TDX_BOLL_df(df)
        for i in range(60, len(df)):
            df_cur = df[:i]
            c = Recognize_boll(base_boll_up, df_cur)
            c2 = Recognize_boll(base_boll_lower, df_cur)
            b = c._calc_beta_up()
            b2 = c._calc_beta_lower()
            #if c2.is_matched():
            #print(b2)
            if abs(c.sign()) > 0 or abs(c2.sign()) > 0:
                df_cur = df_cur[['c', 'boll_up', 'boll_mid', 'boll_lower']]
                df_cur.index = range(len(df_cur))
                df_cur.plot()
                pl.show()
示例#2
0
 def get():
     from autoxd.warp_pytdx import getFive
     from autoxd.pinyin import stock_pinyin3 as jx
     code = jx.HWWH
     df = getFive(code)
     df = stock.TDX_BOLL_df(df)
     return df
示例#3
0
 def getLocal():
     import pandas as pd
     fname = '../datas/002304.csv'
     df = pd.read_csv(fname)
     df.index = pd.DatetimeIndex(df[df.columns[0]])
     df = stock.TDX_BOLL_df(df)
     return df
示例#4
0
 def getLocal(code):
     import pandas as pd
     from autoxd.cnn_boll import env
     fname = '../datas/%s.csv' % (code)
     fname = env.get_root_path() + '/datas/%s.csv' % (code)
     import os
     print(os.path.abspath(fname))
     df = pd.read_csv(fname)
     df.index = pd.DatetimeIndex(df[df.columns[0]])
     df = stock.TDX_BOLL_df(df)
     return df