def main(): Connect() pInstr = EnsureDispatch('XTAPI.TTInstrObj') pInstr.Exchange = 'CME-A' pInstr.Product = 'CL' pInstr.Contract = 'CL Mar13' pInstr.ProdType = 'FUTURE' NOTIFY.Subscribe(pInstr) for i in range(10): pythoncom.PumpWaitingMessages() sleep(1.0)
def main(): ns = osbrain.run_nameserver() ## alice = run_agent('Alice') bob = osbrain.run_agent('Bob') # System configuration ## addr = alice.bind('PUSH', alias='main') Connect() bob.connect(Notify.addr, handler=log_message) pInstr = EnsureDispatch('XTAPI.TTInstrObj') pInstr.Exchange = 'TOCOM-B' pInstr.Product = 'RSS3' pInstr.Contract = '24Jun19' pInstr.ProdType = 'FUTURE' Notify.Subscribe(pInstr) for i in range(10): print('pumping...') pythoncom.PumpWaitingMessages() sleep(1.0)