def main(): if len(sys.argv) != 2: print("usage: SMGExchange.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) host = config.getConfigItem("DatabaseInfo", "host") user = config.getConfigItem("DatabaseInfo", "user") password = config.getConfigItem("DatabaseInfo", "passwd") database = config.getConfigItem("DatabaseInfo", "db") suffix = config.getConfigItem("OrderManager", "omsuffix") orderSeq = int(config.getConfigItem("OrderManager", "orderseq")) fillSeq = int(config.getConfigItem("OrderManager", "fillseq")) systemName = config.getConfigItem("OrderManager", "systemname") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") if host is None or user is None or password is None or database is None or suffix is None \ or orderSeq is None or fillSeq is None or systemName is None or logFile is None or logLevel is None: print("Invalid configuration data. Please check your configuration") exit(1) client = SMGExchange(host, user, password, database, suffix, orderSeq, fillSeq, systemName, logFile, logLevel) client.run()
def main(): if len(sys.argv) != 2: print("usage: SMGTestConsole.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) host = config.getConfigItem("DatabaseInfo", "host") user = config.getConfigItem("DatabaseInfo", "user") password = config.getConfigItem("DatabaseInfo", "passwd") database = config.getConfigItem("DatabaseInfo", "db") suffix = config.getConfigItem("OrderManager", "omsuffix") orderSeq = int(config.getConfigItem("OrderManager", "orderseq")) fillSeq = int(config.getConfigItem("OrderManager", "fillseq")) systemName = config.getConfigItem("OrderManager", "systemname") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") dbMgr = StockMarketDB(user, password, host) dbMgr.connect() dbMgr.changeDb(database) orderMgr = SMGOrderManager(suffix, orderSeq, fillSeq, systemName) logger = SMGLogger(logFile, logLevel) logger.info("Started up SMGTestConsole") userMgr = UserManager(host, user, password, logger) userMgr.connect(database) userMgr.loadInitialData() run(logger, dbMgr, orderMgr, userMgr)
def main(): if len(sys.argv) != 2: print("usage: SMGBankManager.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) host = config.getConfigItem("DatabaseInfo", "host") user = config.getConfigItem("DatabaseInfo", "user") password = config.getConfigItem("DatabaseInfo", "passwd") database = config.getConfigItem("DatabaseInfo", "db") suffix = config.getConfigItem("OrderManager", "omsuffix") systemName = config.getConfigItem("OrderManager", "systemname") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") if host is None or user is None or password is None or database is None or suffix is None \ or systemName is None or logFile is None or logLevel is None: print("Invalid configuration data. Please check your configuration") exit(1) with SMGBankManager(host, user, password, database, logFile, logLevel, suffix, systemName) as bankMgr: with OrderSequenceQuery(host, user, password, database) as seq: bankMgr.OrderMgr.setOrderSeq(seq.getOrderSeq(systemName)) bankMgr.OrderMgr.setFillSeq(seq.getFillSeq(systemName)) bankMgr.ExtOrderId = seq.getExtOrderSeq(systemName) with OrderLoader(host, user, password, database) as orderLoad: orderLoad.loadOrders(bankMgr.OrderMgr, systemName) orderLoad.loadFills(bankMgr.OrderMgr, systemName) bankMgr.run()
def main(): if len(sys.argv) != 2: print("usage: SMGOrderSimulator.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) host = config.getConfigItem("DatabaseInfo", "host") user = config.getConfigItem("DatabaseInfo", "user") password = config.getConfigItem("DatabaseInfo", "passwd") database = config.getConfigItem("DatabaseInfo", "db") suffix = config.getConfigItem("OrderManager", "omsuffix") orderSeq = int(config.getConfigItem("OrderManager", "orderseq")) fillSeq = int(config.getConfigItem("OrderManager", "fillseq")) systemName = config.getConfigItem("OrderManager", "systemname") defaultSide = config.getConfigItem("OrderManager", "defaultside") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") if host is None or user is None or password is None or database is None or suffix is None \ or orderSeq is None or fillSeq is None or systemName is None or defaultSide is None \ or logFile is None or logLevel is None: print("Invalid configuration data. Please check your configuration") exit(1) simulator = SMGOrderSimulator(host, user, password, database, suffix, orderSeq, fillSeq, systemName, defaultSide, logFile, logLevel) with OrderSequenceQuery(host, user, password, database) as seq: simulator.OM.setOrderSeq(seq.getOrderSeq(systemName)) simulator.OM.setFillSeq(seq.getFillSeq(systemName)) simulator.run()
def main(): if len(sys.argv) != 2: print("usage: SMGUserManager.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) host = config.getConfigItem("DatabaseInfo", "host") user = config.getConfigItem("DatabaseInfo", "user") password = config.getConfigItem("DatabaseInfo", "passwd") database = config.getConfigItem("DatabaseInfo", "db") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") if host is None or user is None or password is None or database is None or logFile is None or logLevel is None: print("Invalid configuration items. Please check config file.") exit(1) userMgr = SMGUserManager(host, user, password, logFile, logLevel) userMgr.run(database)
def main(): if len(sys.argv) != 2: print("usage: GDAXFeedHandler.py <configfile>") exit(1) config = SMGConfigMgr() config.load(sys.argv[1]) connection = config.getConfigItem("FeedHandler", "connection") tickerFile = config.getConfigItem("FeedHandler", "tickerfile") logFile = config.getConfigItem("Logging", "filename") logLevel = config.getConfigItem("Logging", "loglevel") if connection is None or tickerFile is None or logFile is None or logLevel is None: print("Invalid configuration. Please check") exit(1) test = GDAXFeedHandler(connection, tickerFile, logFile, logLevel) test.Logger.info("Getting Ready to run") test.run()