private void SubQuotesDepth(String idlist) { short istatus; istatus = quoteCom.SubQuotesDepth(idlist); if (istatus < 0) // { AddInfo("五檔:" + quoteCom.GetSubQuoteMsg(istatus)); } }
static void Main(string[] args) { quotecom = new Intelligence.QuoteCom(host, port, SID, Token); //接收證券行情物件 quotecom.SourceId = SID; quotecom.OnRcvMessage += OnQuoteRcvMessage; quotecom.OnGetStatus += OnQuoteGetStatus; quotecom.OnRecoverStatus += OnRecoverStatus; tfcom = new Smart.TaiFexCom(host, port, SID); // 券證下單物件 tfcom.OnRcvMessage += OntfcomRcvMessage; //資料接收事件 tfcom.OnGetStatus += OntfcomGetStatus; //狀態通知事件 //tfcom.OnRcvServerTime += OntfcomRcvServerTime; //接收主機時間 //tfcom.OnRecoverStatus += OntfcomRecoverStatus; //回補狀態通知 tfcom.LoginDirect(host, port, id, pwd, ' '); tfcom.AutoSubReportSecurity = true; tfcom.AutoRecoverReport = true; Console.ReadLine(); quotecom.Connect2Quote(host, port, id, pwd, area, ""); Console.ReadLine(); quotecom.SubQuotesDepth("6223"); quotecom.SubQuotesMatch("6223"); Console.ReadLine(); TradeBotBase tb = new TradeBotQA("6223", brokerid, account, 1, quotecom, tfcom, 1.5, 109, 100, BuyMode.Auto, StopLossMode.Auto, LockGainMode.Auto); tb.StatusChange += ShowChanges; tb.Start(); //AddInfo(tfcom.Accounts); //Console.WriteLine(brokerid); //Console.WriteLine(account); Console.ReadLine(); tb.BuyStock(); Console.ReadLine(); tb.SellStock(); //quotecom.SubQuotesDepth("2317"); //quotecom.SubQuotesMatch("2317"); //Console.ReadLine(); //TradeBot tb2 = new TradeBot("2317", brokerid, account, 1, quotecom, tfcom,1.5); //tb2.StatusChange += ShowChanges; //tb2.Start(); }
private void btnSubTSEC_Click(object sender, EventArgs e) { short istatus; if (cbMatch.Checked) { istatus = quoteCom.SubQuotesMatch(txtTSEC.Text); if (istatus < 0) // { AddInfo("成交:" + quoteCom.GetSubQuoteMsg(istatus)); } } if (cbDepth.Checked) { istatus = quoteCom.SubQuotesDepth(txtTSEC.Text); if (istatus < 0) // { AddInfo("五檔:" + quoteCom.GetSubQuoteMsg(istatus)); } } }