get_fundamentals()函数可以用于查询单个交易日一只股票或多只股票的财务数据,其语法格式如下: get_fundamentals(query_object, date=None, statDate=None) 1. 各项参数的意义 get_fundamentals()函数共有3项参数,各项参数意义如下: query_object 参数query_object是一个sqlalchemy.orm.query.Query对象,可以通过全局的...
get_fundamentals()函数可以用于查询单个交易日一只股票或多只股票的财务数据,其语法格式如下: get_fundamentals(query_object, date=None, statDate=None) 各项参数的意义 get_fundamentals()函数共有3项参数,各项参数意义如下: 1.query_object 参数query_object是一个sqlalchemy.orm.query.Query对象,可以通过全局的q...
参数query_object是一个sqlalchemy.orm.query.Query对象,可以通过全局的query函数获取Query对象。 参数end_date,与get_fundamentals()函数中的date意义相同,即查询日期。 参数count用于获取end_date前count个日期的数据。 get_fundamentals_continuously()函数的返回值一个pandas.Panel。 单击聚宽JoinQuant量化炒股平台中的“...
代码如下: def get_data(context, bar_dict): # logger.info("---") # 进行每月的第一天去调整要买卖的股票 q = query(fundamentals.eod_derivative_indicator.pe_ratio, fundamentals.eod_derivative_indicator.pcf_ratio).filter( fundamentals.eod_derivative_indicator.pe_ratio > 20, ).order_by( fundament...
get_stock_exrights(stock_code, date=None) 使用场景 该函数在研究、回测、交易模块可用 接口说明 该接口用于获取股票除权除息信息。 注意事项: 无 参数 stock_code; str类型, 股票代码(str); date: 查询该日期的除权除息信息,默认获取该股票历史上所有除权除息信息,e.g. '20180228'/20180228/datetime.date(201...
get_fundamentals(query, entry_date, interval=None, report_quarter=False) 获取历史财务数据表格,目前支持中国市场超过400个指标,具体请参考:RiceQuant米筐量化交易平台。目前仅仅支持中国市场。我们特别为该函数进行了优化,读取内存的操作会极大地提升数据的获取速度。
:return:"""data= get_fundamentals(query(indicator).filter(indicator.code == code), date=date, statDate=statDate)#获取财务指标数据returndata 获取单个股票估值指标 defget_single_valuation(code, date, statDate):"""获取单个股票估值指标 :param code: ...
import datetimeimport matplotlib.pyplot as pltdef get_index_value_date(index_code , date): stocks = get_index_stocks(index_code , date) q = query( valuation.pe_ratio , valuation.market_cap ).filter( valuation.code.in_(stocks) ) df = get_fundamentals(q, date) sum_p = sum(df.market...
Get ready to embark on an exciting learning adventure with Python! Let's dive in and unlock the power of this versatile programming language. 此课程面向哪些人: The Python Fundamentals course is designed for individuals who are interested in learning Python programming and acquiring a solid foundatio...
g.security= get_index_stocks('000002.XSHG') g.q=query(valuation, indicator).filter(valuation.code.in_(g.security)) g.N= 20run_monthly(handle,1)defhandle(context): df= get_fundamentals(g.q)[['code','market_cap','roe']] df['market_cap'] = (df['market_cap'] - df['market_cap...