def getFactorDailyAllData(): sql = '''select * from baozh.dbo.FactorDaily_Comparable''' engine = getengine() df = dbaccessor.query(engine, sql) return df
def getMonthlyStocks(): sql = '''select distinct SecuCode from baozh.dbo.FactorMonthly_Comparable order by SecuCode ''' engine = getengine() df = dbaccessor.query(engine, sql) return df
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
def getFactorMonthlyDelta(): sql = ''' select * from advancedb.dbo.FactorMonthlyTopBottomDelta order by TradingDay desc ''' engine = getengine() df = dbaccessor.query(engine, sql) return df
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
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
def getFactorMonthlyData(td, path): sql = getFactorDataSql(td, 'queryfactormonthly.sql', path) engine = dataapi.getengine() df = dbaccessor.query(engine, sql) return df
def getMonthlyStockData(secucode, path): sql = getMonthlyStockDataSql(secucode, path) engine = dataapi.getengine() df = dbaccessor.query(engine, sql) return df