def __init__(self): pandas.set_option('display.max_columns', 50) pandas.set_option('display.precision', 3) pandas.set_option('display.expand_frame_repr', False) #expand wide dataframe pandas.set_option('display.max_rows', 1500) #pandas.set_option('display.width', 100) #pandas.set_option('max_colwidth', 600) #pandas.set_option('display.float_format', lambda x: '%.3f' % x) self.outputpath = "../result/" #self.mscfg = "./marketscan.cfg" #?? self.mfeed = ms_feed.ms_feed() self.backtest = ms_backtest.ms_backtest() self.csvchart = ms_csvchart.ms_csvchart() self.mtd = marketdata.MarketData() self.datacfg = ms_config.MsDataCfg("") self.cachepath = self.datacfg.getDataConfig("folder","../cache/") self.sgyInxDct={} self.rawData = {} # MarketScan.RawData() self.app_param = ms_paramparser.AppParam() self.param_parser = ms_paramparser.ms_paramparser() global g_marketscan g_marketscan = self # cahce the last result return
def download(self, argstr=""): if (argstr == ""): args = sys.argv[1:] else: args = argstr.split() self.params = ms_paramparser.ms_paramparser() self.params.parseOption(args) df = self.params.getSymbolDf() ticklist = df['symbol'] self._downloadData(ticklist)
def download(self, argstr=""): print("download zack data") start = timer() if (argstr == ""): args = sys.argv[1:] else: args = argstr.split() self.params = ms_paramparser.ms_paramparser() self.params.parseOption(args) df = self.params.getSymbolDf() self._downloadData(df) end = timer() print "finished with time", round(end - start, 3)
def main(self): params = ms_paramparser.ms_paramparser() params.parseOption(sys.argv[1:]) if (params.tickdf.empty): df = self.mtd.loadSymbolLstFile(params.symbolLstFile) df = self.mtd.getSymbolByPid(df, params.pid)[['symbol']] else: df = params.tickdf if (not 'ms_pvm' in params.sgyparam): args = dict((k, '') for k in self.columns) else: args = params.sgyparam['ms_pvm'] df = self.process(df, args) print df pass
def download(self, argstr=""): if (argstr == ""): args = sys.argv[1:] else: args = argstr.split() param_parser = ms_paramparser.ms_paramparser() app_param = param_parser.parseOption(args) self.initOption(app_param) #df1 = app_params.getSymbolDf() df1 = self.mtd.get_symbol_df(app_param) print "ms_feed downloading..." start = timer() self._downloadAll(df1) end = timer() print "\tfinished with time", round(end - start, 3)
def process(self, args=""): #print "I am in!" #sys.exit() #args = sys.argv[1:] if (args == ""): args = sys.argv[1:] params = ms_paramparser.ms_paramparser() params.parseOption(args) self.initOption(params) if params.tickdf.empty: print "loading from symbolfile..." df = self.mtd.loadSymbolLstFile(params.symbolLstFile) df1 = self.mtd.getSymbolByPid(df, params.pid)[['symbol']] #ticklist = df1['symbol'] else: print "using ticklist from command line..." df1 = params.tickdf #if (params.savemd): self.getOhlcAll(df1, params)
def __init__(self): self.sgyfile = "cb_daemon.cfg" self.msconfig = ms_config.MsDataCfg(self.sgyfile) self.datacfg = ms_config.MsDataCfg("") self.param_parser = ms_paramparser.ms_paramparser() self.task_lst = OrderedDict() self.module_dct = {'cb_daemon': self} # must initial the dct with self, otherwise will create duplication self.interactive = False self.report = cb_report.CbReport() self.load_task_config() self.typelst = ["download", "load", ""] self.global_setting = "" self.internalcmd = {'list': (self.listCmd, 'list task'), 'help': (self.help, 'help'), 'exit': (self.exit, 'exit program'), 'runtype': (self.runtype, 'run tasks by type'), 'reload': (self.reload, 'reload config'), 'config': (self.config, 'config running parameter')} pass
def __init__(self): pandas.set_option('display.max_columns', 50) pandas.set_option('display.precision', 3) pandas.set_option('display.expand_frame_repr', False) #expand wide dataframe pandas.set_option('display.max_rows', 1500) #pandas.set_option('display.width', 100) #pandas.set_option('max_colwidth', 600) #pandas.set_option('display.float_format', lambda x: '%.3f' % x) self.outputpath = "../result/" #self.mscfg = "./marketscan.cfg" #?? self.mtd = marketdata.MarketData() self.mfeed = ms_feed.ms_feed() self.csvchart = ms_csvchart.ms_csvchart() self.params = ms_paramparser.ms_paramparser() self.datacfg = ms_config.MsDataCfg("") self.cachepath = self.datacfg.getDataConfig("folder","../cache/") self.sgyInx={} self.sp500 = "^GSPC" #? self.nmuBest = 1 #?? return