예제 #1
0
 def Init(self):
     """ <summary>
      Initialize TT API
      </summary>
     """
     # Use "Universal Login" Login Mode
     h = ttapi.ApiInitializeHandler(self.ttApiInitComplete)
     ttapi.TTAPI.CreateUniversalLoginTTAPI(ttapi.Dispatcher.Current, self.m_username, self.m_password,h)
예제 #2
0
 def Init(self):
     """ <summary>
      Initialize TT API
      </summary>
     """
     # Use "Universal Login" Login Mode
     h = ttapi.ApiInitializeHandler(self.ttApiInitComplete)
     ttapi.TTAPI.CreateXTraderModeTTAPI(ttapi.Dispatcher.Current, h)
예제 #3
0
clr.AddReference('C:\\tt\\ttapi\\bin\\TradingTechnologies.TTAPI')

import TradingTechnologies.TTAPI as ttapi

help(ttapi)

ttapi.XTraderModeTTAPI
print(ttapi.XTraderModeTTAPI)
ttapi.XTraderModeTTAPI.Start()
ttapi.XTraderModeTTAPI.StartFillFeed
ttapi.XTraderModeTTAPI.StartFillFeed()
help(ttapi.Dispatcher)
disp = ttapi.Dispatcher.AttachWorkerDispatcher()
disp.BeginInvoke(new Action(Init))
disp.BeginInvoke(Action(Init))
disp.BeginInvoke(Action)
disp.BeginInvoke()
disp = ttapi.Dispatcher.AttachUIDispatcher()
h=ttapi.ApiInitializeHandler()
h=ttapi.ApiInitializeHandler(ttapi.FillUpdateFlag)
ttapi.XTraderModeTTAPIOptions.StartOrderFillFeed()
ttapi.XTraderModeTTAPI.ConnectionStatusUpdate()
ttapi.XTraderModeTTAPI.CreateXTraderModeTTAPI(disp,h)
ttapi.XTraderModeTTAPI.ConnectionStatusUpdate()
star = ttapi.XTraderModeTTAPI.CreateXTraderModeTTAPI(disp,h)
star = ttapi.XTraderModeTTAPI.Start()
ttapi.Session()
ttapi.XTraderModeTTAPI.ConnectionStatusUpdate()
ttapi.XTraderModeTTAPI.m_UserName()
ttapi.XTraderModeTTAPI.Shutdown()
예제 #4
0
                self.m_req.Update -= self.m_req_Update
                self.m_req.Dispose()
                self.m_req = None
            if (self.m_ps != None):
                self.m_ps.FieldsUpdated -= self.m_ps_FieldsUpdated
                self.m_ps.Dispose()
                self.m_ps = None
        #Begin shutdown the TT API
        ttapi.TTAPI.ShutdownCompleted += self.TTAPI_ShutdownCompleted
        ttapi.TTAPI.Shutdown()
        self.m_disposed = True

# Unattached callbacks and dispose of all subscriptions
# Begin shutdown the TT API

    def TTAPI_ShutdownCompleted(self, sender, e):
        """ <summary>
		 Event notification for completion of TT API shutdown
		 </summary>
        """
        # Shutdown the Dispatcher
        if self.m_disp != None:
            self.m_disp.BeginInvokeShutdown()
            self.m_disp = None

with ttapi.Dispatcher.AttachUIDispatcher() as disp:
    tr = TTAPIReadForm()
    m_handler = ttapi.ApiInitializeHandler(tr.ttApiInitHandler)
    ttapi.TTAPI.CreateXTraderModeTTAPI(disp, m_handler)
    Application.Run(tr)
예제 #5
0
 def loginBtn_eventhandler(self, sender, event):
     ##tf = TTAPIFunctions("CHOODTS","12345678")
     name = sender.Name
     self.m_disp = ttapi.Dispatcher.AttachUIDispatcher()
     self.m_handler = ttapi.ApiInitializeHandler(tr.ttApiInitHandler)
     ttapi.TTAPI.CreateXTraderModeTTAPI(self.m_disp, self.m_handler)