def m_apiInstance_ConnectionStatusUpdate(self, sender, e): """ <summary> Event notification for status of authentication </summary> """ if e.Status.IsSuccess: # Add code here to begin working with the TT API # lookup an instrument self.m_req = ttapi.InstrumentLookupSubscription( self.m_apiInstance.Session, ttapi.Dispatcher.Current, ttapi.ProductKey(ttapi.MarketKey.Cme, ttapi.ProductType.Future, "YM"), "Jun17") self.m_req.Update += self.m_req_Update print("Connection Success!") self.m_req.Start() else: print("TT Login failed: {0}".format(e.Status.StatusMessage)) self.Dispose()
def m_apiInstance_ConnectionStatusUpdate(self, sender, e): """ <summary> Event notification for status of authentication </summary> """ if e.Status.IsSuccess: # Add code here to begin working with the TT API # lookup an instrument self.m_req = ttapi.InstrumentLookupSubscription( self.m_apiInstance.Session, ttapi.Dispatcher.Current, ttapi.ProductKey(self.instrexch, self.instrType, self.instr), self.instrMonth) self.m_req.Update += self.m_req_Update self.statusbar.Text = 'Connection Success... YOU R IN!' ## print("Connection Success!") self.m_req.Start() else: print("TT Login failed: {0}".format(e.Status.StatusMessage)) self.statusbar.Text = "TT Login failed: {0}".format( e.Status.StatusMessage) self.Dispose()