static void Main() { using (Dispatcher disp = Dispatcher.AttachUIDispatcher()) { Application.EnableVisualStyles(); // Create an instance of the API MarketExplorer marketExplorer = new MarketExplorer(); // Add your app secret Key here. It looks like: 00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000 string appSecretKey = "Add your app secret Key here"; // Add the host machine instance id assigned to you by TT only needed for Server mode. If set in // Client mode, it will simply be ignored string instanceId = "Add your host machine instance id here"; // Set the environment the app needs to run in here tt_net_sdk.ServiceEnvironment environment = tt_net_sdk.ServiceEnvironment.UatCert; // Select the mode in which you wish to run -- Client (outside the TT datacenter) // or Server (on a dedicated machine inside TT datacenter) tt_net_sdk.TTAPIOptions.SDKMode sdkMode = tt_net_sdk.TTAPIOptions.SDKMode.Client; tt_net_sdk.TTAPIOptions apiConfig = new tt_net_sdk.TTAPIOptions( sdkMode, environment, appSecretKey, 5000); // set the instance id and any other options needed apiConfig.ServerInstanceId = instanceId; ApiInitializeHandler handler = new ApiInitializeHandler(marketExplorer.ttNetApiInitHandler); TTAPI.CreateTTAPI(disp, apiConfig, handler); Application.Run(marketExplorer); } }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Initialize the API </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// public void Init(tt_net_sdk.TTAPIOptions apiConfig) { ApiInitializeHandler apiInitializeHandler = new ApiInitializeHandler(ttNetApiInitHandler); TTAPI.ShutdownCompleted += TTAPI_ShutdownCompleted; TTAPI.CreateTTAPI(tt_net_sdk.Dispatcher.Current, apiConfig, apiInitializeHandler); }
//////////////////////////////////////////////////////////////////////////////////////////////////// /// <summary> Initialize the API </summary> //////////////////////////////////////////////////////////////////////////////////////////////////// public void Init(tt_net_sdk.TTAPIOptions apiConfig) { ApiInitializeHandler apiInitializeHandler = new ApiInitializeHandler(ttNetApiInitHandler); TTAPI.ShutdownCompleted += TTAPI_ShutdownCompleted; //For Algo Orders apiConfig.AlgoUserDisconnectAction = UserDisconnectAction.Cancel; TTAPI.CreateTTAPI(tt_net_sdk.Dispatcher.Current, apiConfig, apiInitializeHandler); }
public MainWindow() { InitializeComponent(); this.DataContext = this; treeviewList.ItemsSource = MarketListData; var app = App.Current as TTNETAPI_Sample_WPF_VolumeRatio.App; m_dispatcher = app.SDKDispatcher; var app_key = "app_key"; var env = ServiceEnvironment.ProdSim; var mode = TTAPIOptions.SDKMode.Client; var options = new TTAPIOptions(mode, env, app_key, 5000); TTAPI.CreateTTAPI(m_dispatcher, options, new ApiInitializeHandler(OnSDKInitialized)); lblStatus.Text = "Initializing..."; }
static void Main() { using (Dispatcher disp = Dispatcher.AttachUIDispatcher()) { Application.EnableVisualStyles(); // Create an instance of the API MarketExplorer marketExplorer = new MarketExplorer(); // Add your app secret Key here. It looks like: 00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000 string appSecretKey = "Add your app secret Key here"; tt_net_sdk.ServiceEnvironment environment = tt_net_sdk.ServiceEnvironment.UatCert; tt_net_sdk.TTAPIOptions apiConfig = new tt_net_sdk.TTAPIOptions(environment, appSecretKey, 5000); ApiInitializeHandler handler = new ApiInitializeHandler(marketExplorer.ttNetApiInitHandler); TTAPI.CreateTTAPI(disp, apiConfig, handler); Application.Run(marketExplorer); } }
static void Main() { using (Dispatcher disp = Dispatcher.AttachUIDispatcher()) { Application.EnableVisualStyles(); // Create an instance of the API MarketExplorer marketExplorer = new MarketExplorer(); // Add your app secret Key here. It looks like: 00000000-0000-0000-0000-000000000000:00000000-0000-0000-0000-000000000000 string appSecretKey = "240bc7e6-ba70-b3eb-b99c-28b34865525b:91ecb109-b5fc-5eaf-96ab-af8539b8fd5a"; tt_net_sdk.ServiceEnvironment environment = tt_net_sdk.ServiceEnvironment.DevCert; tt_net_sdk.TTAPIOptions apiConfig = new tt_net_sdk.TTAPIOptions(environment, appSecretKey, 5000); ApiInitializeHandler handler = new ApiInitializeHandler(marketExplorer.ttNetApiInitHandler); TTAPI.CreateTTAPI(disp, apiConfig, handler); Application.Run(marketExplorer); } }
public void Init(TTAPIOptions apiConfig) { ApiInitializeHandler apiInitializeHandler = new ApiInitializeHandler(ttNetApiInitHandler); TTAPI.CreateTTAPI(Dispatcher.Current, apiConfig, apiInitializeHandler); }