static void Main(string[] args) { //API初始化 FTAPI.Init(); //FTAPI_Qot client = new FTAPI_Qot(); //client.SetConnCallback(new SampleConnCallback()); //client.SetQotCallback(new SampleQotCallback()); //client.SetClientInfo("FTAPI4NET_Sample", 1); ////client.SetRSAPrivateKey(System.IO.File.ReadAllText(@"d:\rsa1024", Encoding.UTF8)); //client.InitConnect("127.0.0.1", 11111, false); //交易API初始化 FTAPI_Trd trd = new FTAPI_Trd(); //注册连接回调 trd.SetConnCallback(new SampleTrdConnCallback()); //注册交易回调 trd.SetTrdCallback(new SampleTrdCallback()); //设置Clint信息 trd.SetClientInfo("FTAPI4NET_Sample", 1); //开始链接 trd.InitConnect("127.0.0.1", 11111, false); while (true) { Thread.Sleep(1000 * 60); } }
static void Main(string[] args) { FTAPI.Init(); FTAPI_Qot client = new FTAPI_Qot(); client.SetConnCallback(new SampleConnCallback()); client.SetQotCallback(new SampleQotCallback()); client.SetClientInfo("FTAPI4NET_Sample", 1); //client.SetRSAPrivateKey(System.IO.File.ReadAllText(@"d:\rsa1024", Encoding.UTF8)); //client.InitConnect("127.0.0.1", 11111, false); { GetSecuritySnapshotDemo demo = new GetSecuritySnapshotDemo(); demo.Run(QotCommon.QotMarket.QotMarket_HK_Security); } { //QuoteAndTradeDemo demo = new QuoteAndTradeDemo(); //demo.TradeHkTest(); } //FTAPI_Trd trd = new FTAPI_Trd(); //trd.SetConnCallback(new SampleTrdConnCallback()); //trd.SetTrdCallback(new SampleTrdCallback()); //trd.SetClientInfo("FTAPI4NET_Sample", 1); //trd.InitConnect("127.0.0.1", 11111, false); while (true) { Thread.Sleep(1000 * 60); } }
static void Main(string[] args) { FTAPI.Init(); FTAPI_Qot client = new FTAPI_Qot(); client.SetConnCallback(new SampleConnCallback()); client.SetQotCallback(new SampleQotCallback()); client.SetClientInfo("FTAPI4NET_Sample", 1); //client.SetRSAPrivateKey(System.IO.File.ReadAllText(@"d:\rsa1024", Encoding.UTF8)); client.InitConnect("127.0.0.1", 11111, false); FTAPI_Trd trd = new FTAPI_Trd(); trd.SetConnCallback(new SampleTrdConnCallback()); trd.SetTrdCallback(new SampleTrdCallback()); trd.SetClientInfo("FTAPI4NET_Sample", 1); trd.InitConnect("127.0.0.1", 11111, false); /* * FTClient client = new FTClient("127.0.0.1", 11111); * client.QotConnCallback.InitConnected += QotConnCallback_InitConnected; * client.QotConnCallback.Disconnected += QotConnCallback_Disconnected; * client.Connect(); */ while (true) { Thread.Sleep(1000); //client.Close(); //client.Dispose(); Thread.Sleep(1000 * 200); } }
internal FTClient(FTController controller) { FTController = controller; FTAPI.Init(); qot.SetConnCallback(new ConnCallback(this)); QotCallback = new QotCallback(this); qot.SetQotCallback(QotCallback); qot.SetClientInfo("FT DataSource Plugin for AB", 1); }
private void Button1_Click(object sender, EventArgs e) { //API初始化 FTAPI.Init(); AppendLogInfo("Begin login op..."); //交易API初始化 trd = new FTAPI_Trd(); //注册连接回调 trd.SetConnCallback(m_stcon); //注册交易回调 trd.SetTrdCallback(m_st); //设置Clint信息 trd.SetClientInfo("FTAPI4NET_Sample", 1); //开始链接 trd.InitConnect("127.0.0.1", 11111, false); }