コード例 #1
0
    def select_x003(cls, st_df):
        """
        k30
        """
        name = "s003"

        mdi_df = ZB.mdi(st_df)
        x1 = (mdi_df["DIFF"] > mdi_df["DIFF"].shift(1)) & (mdi_df["DIFF"] > mdi_df["DIFF"].shift(2))
        x2 = ZB.cross(mdi_df['ADX'], mdi_df['ADXR'])

        mdi_df[name] = False

        mdi_df.ix[x1 & x2, name] = True

        return mdi_df.ix[:, [name]]
コード例 #2
0
ファイル: buy_sale.py プロジェクト: yezhichen2/stock_by_point
    def select_x003(cls, st_df):
        """
        k30
        """
        name = "selected"

        mdi_df = ZB.mdi(st_df)

        x1 = mdi_df["DIFF"] > mdi_df["DIFF"].shift(1)
        x2 = ZB.cross(mdi_df['ADXR'], mdi_df['ADX'])

        t1 = (mdi_df.index.hour > 10) & (mdi_df.index.hour <= 14)
        mdi_df[name] = False

        mdi_df.ix[t1 & x1 & x2, name] = True

        return mdi_df.ix[:, [name]]
コード例 #3
0
    def select_x003(cls, st_df):
        """
        k30
        """
        name = "s003"

        kdj_df = ZB.kdj(st_df)

        x1 = ZB.cross(kdj_df["kdj_k"], kdj_df["kdj_d"])
        x2 = kdj_df["kdj_k"] <= 60

        t1 = kdj_df.index.hour >= 11

        kdj_df[name] = False

        kdj_df.ix[t1 & x1 & x2, name] = True

        return kdj_df.ix[:, [name]]
コード例 #4
0
    def select_x003(cls, st_df):
        """
        k30
        """
        name = "selected"

        mdi_df = ZB.mdi(st_df)
        ma_df = ZB.ma(st_df)
        close = st_df['close']

        x1 = ZB.cross(mdi_df['ADX'], mdi_df['ADXR']) & (mdi_df['ADXR'] < 30)
        x2 = mdi_df['DIFF'] > mdi_df['DIFF'].shift(1)
        x21 = (mdi_df['PDI'] > mdi_df['ADXR']) & (mdi_df['PDI'] > mdi_df['MDI'])
        x3 = (ma_df['ma50'] <= close + (close * 0.02)) & (ma_df['ma50'] <= close - (close * 0.02))

        t1 = (mdi_df.index.hour > 10) & (mdi_df.index.hour <= 14)
        mdi_df[name] = False

        mdi_df.ix[t1 & x1 & x2 & x21 & x3, name] = True

        return mdi_df.ix[:, [name]]
コード例 #5
0
    def select_x003(cls, st_df):
        """

        """
        name = "s004"

        kdj_df = ZB.kdj(st_df)

        x1 = kdj_df["kdj_k"] < kdj_df['kdj_d']
        x2 = kdj_df["kdj_k"] >= kdj_df["kdj_k"].shift(1)

        x3 = ZB.cross(kdj_df["kdj_k"], kdj_df["kdj_d"])

        t1 = kdj_df.index.hour >= 13

        kdj_df[name] = False

        kdj_df.ix[t1 & x1 & x2, name] = True
        kdj_df.ix[t1 & x3, name] = True

        return kdj_df.ix[:, [name]]
コード例 #6
0
    def select_x004(cls, st_df):
        """

        """
        name = "s004"

        kdj_df = ZB.kdj(st_df)

        diff = kdj_df['kdj_k'] - kdj_df['kdj_d']
        kdj_df["diff"] = diff.ewm(com=1).mean()

        # 高位, 确认趋势变坏
        x1 = kdj_df["diff"] > 0
        x2 = kdj_df["diff"] < kdj_df["diff"].shift(1)
        x3 = kdj_df["diff"].shift(1) <= kdj_df["diff"].shift(2)

        c1 = ZB.cross(kdj_df['kdj_d'], kdj_df['kdj_k'])
        c2 = kdj_df['kdj_k'] >= 30
        kdj_df[name] = False

        kdj_df.ix[x1 & x2 & x3, name] = True
        kdj_df.ix[c1 & c2, name] = True

        return kdj_df.ix[:, [name]]