问答交流

关于财务衍生(最新一期)的数据问题

由luvymhq创建,最终由luvymhq 被浏览 7 用户

import dai 
dai.query("""select a.instrument,a.date,shift,report_date
                from cn_stock_financial_lf_shift a join cn_stock_prefactors b using(instrument,date)
                where a.date between '{0}' and '{1}'
                and b.pe_ttm>0
                    and list_days>=252
                    and st_status = 0
                    and list_sector in('1','2')      
    """.format('2024-04-19','2024-04-19')).df()
    #'end_date':datetime.date.today().strftime("%Y-%m-%d"))

以上sql跑出来是有shift=0的记录的。但为什么在where 条件中限定shift=0 却跑不出结果?

评论
  • cn_stock_financial_lf_shift 不是日频数据,他是公司发布一条公告对应该日期才会有记录,那很可能2024-04-19这天没有公司发布财报
  • 有发的,我巨潮确认过。但你们上面没有
{link}