- UID
- 2
- 积分
- 2874604
- 威望
- 1387331 布
- 龙e币
- 1487273 刀
- 在线时间
- 13155 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-11-24
|
订单与交易及查询相关功能- void test::tend(TDLLPARM t)
- {
- lst.push_back(t.Name);
- parm[t.Name] = t;
- }
- void test::SubscribeMarketData(string s)
- {
- TDLLDATA* t = new TDLLDATA();
- t->sName = sName;
- t->sType = "SubMd";
- t->sData = s;
- if (hwnd)SendMessage(hwnd, WM_SUBMD, (WPARAM)t, 11);
- }
- bool test::IsbeigenOrdrSysID(string orderid)
- {
- list<string>::iterator it;
- for (it = lstbeigenOrdrSysID.begin(); it != lstbeigenOrdrSysID.end(); it++)
- {
- string temp = *it;
- if (temp == orderid)return true;
- }
- return false;
- }
- bool test::IsActionOrdrSysID(string orderid)
- {
- list<string>::iterator it;
- for (it = lstActionOrdrSysID.begin(); it != lstActionOrdrSysID.end(); it++)
- {
- string temp = *it;
- if (temp == orderid)return true;
- }
- return false;
- }
- void test::OrderInsert(string acc, string inst, char bs, char oc, int vol, double price, string forfok, string ref2)
- {
- TORDERINSERT* t = new TORDERINSERT();
- t->sName = sName;
- t->InvestorID = acc;
- t->InstrumentID = inst;
- t->BuySell = bs;
- t->OpenClose = oc;
- t->Volume = vol;
- t->LimitPrice = price;
- t->FakFok = forfok;
- t->Ref1 = sName;
- t->Ref2 = ref2;
- if (hwnd)SendMessage(hwnd, WM_INSERT, (WPARAM)t, 12);
- }
- void test::OrderAction(CThostFtdcOrderField t)
- {
- TACTION* ta = new TACTION();
- ta->Name = sName;
- ta->InvestorID = t.InvestorID;
- ta->OrderSysID = t.OrderSysID;
- ta->BrokerID = t.BrokerID;
- ta->ExchangeID = t.ExchangeID;
- if (hwnd)SendMessage(hwnd, WM_ACTION, (WPARAM)ta, 13);
- }
- void test::RsqBar(string period, string inst)
- {
- TRSQBAR* t = new TRSQBAR();
- t->Name = sName;
- t->Type = "RsqBar";
- t->Period = period;
- t->Inst = inst;
- if (hwnd)SendMessage(hwnd, WM_RSQBAR, (WPARAM)t, (LPARAM)36);
- }
- void test::InsertLog(string msg)
- {
- TMSG* t = new TMSG();
- t->Name = sName;
- t->Msg = msg;
- if (hwnd)SendMessage(hwnd, WM_MSG, (WPARAM)t, 14);
- }
- void test::RsqInstrument(string inst)
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RsqInstrument";
- t->Inst = inst;
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqRspQryOrder()
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RspQryOrder";
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqRspQryTrade()
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RspQryTrade";
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqPosition()
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RsqPosition";
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqPositionDetail(string acc)
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RsqPositionDetail";
- t->Account = acc;
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqCommissionRate()
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RsqCommissionRate";
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::RsqAccount()
- {
- TRSQ* t = new TRSQ();
- t->Name = sName;
- t->Type = "RsqAccount";
- if (hwnd)SendMessage(hwnd, WM_RSQ, (WPARAM)t, (LPARAM)33);
- }
- void test::sound(string s)
- {
- size_t size = s.length();
- wchar_t* buffer = new wchar_t[size + 1];
- MultiByteToWideChar(CP_ACP, 0, s.c_str(), size, buffer, size * sizeof(wchar_t));
- buffer[size] = 0;
- PlaySound(buffer, NULL, SND_FILENAME | SND_ASYNC);
- delete buffer;
- buffer = NULL;
- }
复制代码 |
|