コード例 #1
0
def getFactorDailyAllData():
    sql = '''select
				 * 
				 from baozh.dbo.FactorDaily_Comparable'''
    engine = getengine()
    df = dbaccessor.query(engine, sql)
    return df
コード例 #2
0
def getMonthlyStocks():
    sql = '''select distinct SecuCode
			from baozh.dbo.FactorMonthly_Comparable
			order by SecuCode
		  '''
    engine = getengine()
    df = dbaccessor.query(engine, sql)

    return df
コード例 #3
0
def getTradingDay():
    sql = '''select distinct convert(varchar, TradingDay, 112) as TradingDay
			 from baozh.dbo.FactorDaily_Comparable
             where TradingDay is not null
             order by TradingDay desc
		  '''
    engine = getengine()
    df = dbaccessor.query(engine, sql)

    return df
コード例 #4
0
def getFactorMonthlyDelta():

    sql = '''
			select * from advancedb.dbo.FactorMonthlyTopBottomDelta
			order by TradingDay desc
		'''

    engine = getengine()
    df = dbaccessor.query(engine, sql)
    return df
コード例 #5
0
def getFactorDailyData(td):
    '''需要传入一个时间类型 date 或 datetime'''
    sql = '''select
				 *
				 from baozh.dbo.FactorDaily_Comparable
				 where TradingDay='{0}'
			  '''.format(td.strftime('%Y%m%d'))

    engine = getengine()
    df = dbaccessor.query(engine, sql)
    return df
コード例 #6
0
def getFactorMonthlyStockData(secucode):
    """	secucode - 股票代码
		"""
    sql = '''select 
				 *
				 from baozh.dbo.FactorMonthly_Comparable
				 where SecuCode='{0}'
				 order by TradingDay desc
			'''.format(secucode)

    engine = getengine()
    df = dbaccessor.query(engine, sql)
    return df
コード例 #7
0
def getFactorMonthlyData(td, path):
    sql = getFactorDataSql(td, 'queryfactormonthly.sql', path)

    engine = dataapi.getengine()
    df = dbaccessor.query(engine, sql)
    return df
コード例 #8
0
def getMonthlyStockData(secucode, path):
    sql = getMonthlyStockDataSql(secucode, path)

    engine = dataapi.getengine()
    df = dbaccessor.query(engine, sql)
    return df