Example #1
0
    def grossprofitmargin_diff(self):
        revenue = self.operatingrevenue  # 营业收入
        cost = self.operatingcost  # 营业成本
        # 财务指标常规处理,移动月份,改月末日期
        revenue_q = get_signal_season_value(revenue)
        cost_q = get_signal_season_value(cost)
        gross_q = (revenue_q - cost_q) / revenue_q

        gir_d = CALFUNC.generate_diff(gross_q)
        gir_d = adjust_months(gir_d)
        # 用来扩展月度数据
        gir_d = append_df(gir_d)
        res = CALFUNC.del_dat_early_than(gir_d, START_YEAR)
        return res
Example #2
0
 def Sales_G_q(self):  # qfa_yoysales:单季度.营业收入同比增长率
     operatingrevenue = self.operatingrevenue
     sig_season_operatingrevenue = get_signal_season_value(operatingrevenue)
     sales_g = CALFUNC.generate_yoygr(sig_season_operatingrevenue)
     sales_g = adjust_months(sales_g)
     sales_g = append_df(sales_g)
     sales_g = CALFUNC.del_dat_early_than(sales_g, START_YEAR)
     return sales_g
Example #3
0
 def ROE_G_q(self):  # 单季度.ROE同比增长率
     roe = self.roe
     sig_season_roe = get_signal_season_value(roe)
     roe_g = CALFUNC.generate_yoygr(sig_season_roe)
     roe_g = adjust_months(roe_g)
     roe_g = append_df(roe_g)
     roe_g_q = CALFUNC.del_dat_early_than(roe_g, START_YEAR)
     return roe_g_q
Example #4
0
 def Profit_G_q(self):  # qfa_yoyprofit:单季度.净利润同比增长率
     netprofit = self.netprofitcut  # 扣除非经常损益后的净利润
     sig_season_netprofit = get_signal_season_value(netprofit)
     p_g = CALFUNC.generate_yoygr(sig_season_netprofit)
     p_g = adjust_months(p_g)
     p_g = append_df(p_g)
     profit_g_q = CALFUNC.del_dat_early_than(p_g, START_YEAR)
     return profit_g_q
Example #5
0
 def grossprofitmargin_q(self):
     '''
     计算公示:(营业收入 - 营业成本) / 营业收入 * 100 %
     计算单季度指标,应该先对 营业收入 和 营业成本 分别计算单季度指标,再计算
     '''
     revenue = self.operatingrevenue  # 营业收入
     cost = self.operatingcost  # 营业成本
     # 财务指标常规处理,移动月份,改月末日期
     revenue_q = get_signal_season_value(revenue)
     cost_q = get_signal_season_value(cost)
     gross_q = (revenue_q - cost_q) / revenue_q
     # 调整为公告日期
     tmp = adjust_months(gross_q)
     # 用来扩展月度数据
     tmp = append_df(tmp)
     res = CALFUNC.del_dat_early_than(tmp, START_YEAR)
     return res
Example #6
0
    def Profitmargin_q(self):  # 单季度净利润率
        '''
        1.qfa_deductedprofit:单季度.扣除非经常损益后的净利润
        2.qfa_oper_rev: 单季度.营业收入
        :return:
        '''

        netprofit = self.netprofitcut  # 扣除非经常损益后的净利润
        operatingrevenue = self.operatingrevenue
        sig_season_netprofit = get_signal_season_value(netprofit)
        sig_season_operatingrevenue = get_signal_season_value(operatingrevenue)
        profitmargin_q = sig_season_netprofit / sig_season_operatingrevenue
        profitmargin_q = adjust_months(profitmargin_q)
        profitmargin_q = append_df(profitmargin_q)

        pq = CALFUNC.del_dat_early_than(profitmargin_q, START_YEAR)

        return pq
Example #7
0
    def ROE_q(self):
        totalshareholderequity = self.totalshareholderequity
        netprofit = self.netprofit
        # 得到单季度 净利润
        sig_season_netprofit = get_signal_season_value(netprofit)
        # 得到季度平均总资产
        s_mean_equity = get_season_mean_value(totalshareholderequity)

        roe_q = (sig_season_netprofit / s_mean_equity) * 100
        roe_q = adjust_months(roe_q)
        roe_q = append_df(roe_q)
        roe_q = CALFUNC.del_dat_early_than(roe_q, START_YEAR)
        return roe_q
Example #8
0
    def ROA_q(self):
        totalassets = self.totalassets
        netprofit = self.netprofit
        # 得到单季度 净利润
        sig_season_netprofit = get_signal_season_value(netprofit)
        # 得到季度平均总资产
        s_mean_totalassets = get_season_mean_value(totalassets)

        roa_q = (sig_season_netprofit / s_mean_totalassets) * 100
        roa_q = adjust_months(roa_q)
        roa_q = append_df(roa_q)
        roa_q = CALFUNC.del_dat_early_than(roa_q, START_YEAR)
        return roa_q
Example #9
0
    def assetturnover_q(self):
        totalassets = self.totalassets
        revenue = self.operatingrevenue
        # 得到单季度 净利润
        sig_season_revenue = get_signal_season_value(revenue)
        # 得到季度平均总资产
        s_mean_totalassets = get_season_mean_value(totalassets)

        turnover_q = (sig_season_revenue / s_mean_totalassets) * 100
        turnover_q = adjust_months(turnover_q)
        turnover_q = append_df(turnover_q)
        turnover_q = CALFUNC.del_dat_early_than(turnover_q, START_YEAR)

        return turnover_q
Example #10
0
    def REVSU(self):
        netprofit = self.totaloperatingrevenueps
        # 得到单季度的数据。
        sig_season_va = get_signal_season_value(netprofit)
        cols = pd.DataFrame([i for i in sig_season_va.columns])

        revsu = pd.DataFrame()
        rolling_cols = rolling_windows(cols, 6)
        for roll in rolling_cols:
            res = _calculate_su_simple(sig_season_va[roll])
            res = pd.DataFrame(res.values, index=res.index, columns=[roll[-1]])
            revsu = pd.concat([revsu, res], axis=1)

        revsu.dropna(how='all', axis=0, inplace=True)

        revsu = adjust_months(revsu)
        revsu = append_df(revsu)

        return revsu
Example #11
0
    def SUE(self):
        # 使用原始的财务数据
        eps = self.basiceps
        # 得到单季度的数据。
        sig_season_va = get_signal_season_value(eps)
        cols = pd.DataFrame([i for i in sig_season_va.columns])

        sue = pd.DataFrame()
        rolling_cols = rolling_windows(cols, 6)
        for roll in rolling_cols:
            res = _calculate_su_simple(sig_season_va[roll])
            res = pd.DataFrame(res.values, index=res.index, columns=[roll[-1]])
            sue = pd.concat([sue, res], axis=1)

        sue.dropna(how='all', axis=0, inplace=True)

        sue = adjust_months(sue)
        sue = append_df(sue)

        return sue