当前位置: 首页>>代码示例>>C++>>正文


C++ Order::GetId方法代码示例

本文整理汇总了C++中Order::GetId方法的典型用法代码示例。如果您正苦于以下问题:C++ Order::GetId方法的具体用法?C++ Order::GetId怎么用?C++ Order::GetId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Order的用法示例。


在下文中一共展示了Order::GetId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Process


//.........这里部分代码省略.........
				UpdateBestQuote(msg->m_BuySellIndicator == 'B');
			}
		}
        break;
		case M_FLUSH_ALL:
        case M_FLUSH_ALL_OPEN_BOOKS:
        case M_FLUSH_BOOK_FOR_STOCK:
		case M_FLUSH_ATTRIBUTED_BOOK:
		case M_FLUSH_ATTRIBUTED_BOOK_FOR_STOCK:

        {
            UpdateBestQuote(true);
            UpdateBestQuote(false);
//NYSINFO
            InitNysQuotes();

            unsigned int level;
            GetLevelBid()->GetMmidFirstQuote("ISLD", level, m_isldBidQuote);
            GetLevelAsk()->GetMmidFirstQuote("ISLD", level, m_isldAskQuote);
        }
        break;


        case M_LAST_TRADE_SHORT:
        if(from == m_prints)
        {
			// get time
			time_t now;
			time(&now);
			CTime ct(now);
			int date = (ct.GetYear()*10000) + (ct.GetMonth()*100) + ct.GetDay();
			int time = (ct.GetHour()*100)+ct.GetMinute();
			int sec = ct.GetSecond();
            MsgLastTradeShort* msg = (MsgLastTradeShort*)message;

			TradeLinkServer::TLTrade fill;
			fill.symbol = msg->m_Symbol;
			fill.xprice = (double)msg->m_price/1024;
			CString sym = msg->m_Symbol;
			fill.xsize= msg->m_LastTradeVolume;
			fill.exchange = ExchangeName((int)msg->m_ExecutionExchange);
			fill.xdate = date;
			fill.xtime = time;
			fill.xsec = sec;
			tl->SrvGotFill(fill);
        }
        break;

        case M_POOL_EXECUTION:
//Notification about a new execution.
        if(additionalInfo != NULL && additionalInfo->GetType() == M_AI_EXECUTION)
        {
			// TRADELINK
            MsgPoolExecution* msg = (MsgPoolExecution*)message;//to get the structure, just cast Message* to  MsgPoolExecution* (not used here)
            AIMsgExecution* info = (AIMsgExecution*)additionalInfo;
            Order* order = info->m_order;
			if (!hasFillID(order->GetId())) // don't send same notification twice
			{
				fillids.push_back(order->GetId()); // save the id
				CTime ct(msg->x_Time);
				int xd = (ct.GetYear()*10000)+(ct.GetMonth()*100)+ct.GetDay();
				int xt = (ct.GetHour()*100)+ct.GetMinute();

				TradeLinkServer::TLTrade fill;
				fill.id = order->GetId();
				fill.xsec = ct.GetSecond();
				fill.xtime = xt;
				fill.xdate = xd;
				fill.side = (order->GetSide()=='B');
				fill.comment = order->GetUserDescription();
				fill.symbol = msg->x_Symbol;
				fill.xprice = (double)msg->x_ExecutionPrice/1024;
				fill.xsize = msg->x_NumberOfShares;
				tl->SrvGotFill(fill);
			}
	
		}
		break;

        case M_POOL_UPDATE_ORDER:// Order status is modified
        if(additionalInfo != NULL && additionalInfo->GetType() == M_AI_ORDER)
        {
            AIMsgOrder* info = (AIMsgOrder*)additionalInfo;
            Order* order = info->m_order;
            const Position* position = info->m_position;
			CTime ct(order->GetTimeCreated());
			TradeLinkServer::TLOrder o;
			o.id = order->GetId();
			o.price = order->GetOrderPrice().toDouble();
			o.stop = order->GetStopPrice()->toDouble();
			o.time = (ct.GetHour()*100)+ct.GetMinute();
			o.date = (ct.GetYear()*10000)+(ct.GetMonth()*100)+ct.GetDay();
			o.size = order->GetSize();
			o.comment = order->GetUserDescription();
			o.TIF = TIFName(order->GetTimeInForce());
			tl->SrvGotOrder(o);
		}
		break;
    }
}
开发者ID:Decatf,项目名称:tradelink,代码行数:101,代码来源:AVLStock.cpp


注:本文中的Order::GetId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。