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


C++ CStockInfo::SetType方法代码示例

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


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

示例1: SendRequestQuote

void CMultiSortView::SendRequestQuote( BOOL bForced )
{
	BOOL bInTrade = CSPTime::InTradeTime(CSPTime::GetCurrentTime().GetTime(),900);
	CView * pView = AfxGetStaticDoc()->GetActiveView();
	if( bForced || (bInTrade && pView == this) )
	{
		CStockInfo info;
		info.SetType( m_multisort.GetMultiSortClass( ) );
		AfxGetStkReceiver().RequestStockData( CStock::dataMultisort, &info, 1, 0, 0 );
	}
}
开发者ID:darwinbeing,项目名称:trade,代码行数:11,代码来源:MultiSortView.cpp

示例2: SetMultiSortClass

void CMultiSort::SetMultiSortClass( LONG type )
{
	m_lMultiSortClass	=	type;
	if( modeDirect == m_nRefreshMode )
	{
		CStockInfo info;
		info.SetType( GetMultiSortClass( ) );
		AfxGetStkReceiver().RequestStockData( CStock::dataMultisort, &info, 1, 0, 0 );
	}
	else
	{
		RecalculateSortID( TRUE, TRUE );
	}
}
开发者ID:darwinbeing,项目名称:trade,代码行数:14,代码来源:MultiSort.cpp

示例3: UpdateStockInfoByREPORT

// update CStockInfo by Report data
BOOL UpdateStockInfoByREPORT( CStockInfo & info, REPORT * pReport )
{
	SP_ASSERT( pReport );
	if( !pReport )
		return FALSE;

	// 股票市场
	if( strlen(pReport->m_szCode) > 0 )
		info.SetStockCode( pReport->m_dwMarket, pReport->m_szCode );
	if( strlen(pReport->m_szName) > 0  )
		info.SetStockName( pReport->m_szName );

	if( info.GetType() == 0 )
	{
		if( CStock::marketSHSE == pReport->m_dwMarket )
			info.SetType( CStock::typeshA );
		else if( CStock::marketSZSE == pReport->m_dwMarket )
			info.SetType( CStock::typeszA );
		else
			info.SetType( CStock::typeshA );
	}

	// 成交买卖价量信息
	if( pReport->m_fLast > 1e-4 )	info.m_fLast		=	pReport->m_fLast;
	info.m_fOpen		=	pReport->m_fOpen;
	info.m_fHigh		=	pReport->m_fHigh;
	info.m_fLow			=	pReport->m_fLow;
	info.m_fClose		=	pReport->m_fNew;
	info.m_fVolume		=	pReport->m_fVolume;
	info.m_fAmount		=	pReport->m_fAmount;

	info.m_fBuyPrice[0]		=	pReport->m_fBuyPrice[0];
	info.m_fBuyPrice[1]		=	pReport->m_fBuyPrice[1];
	info.m_fBuyPrice[2]		=	pReport->m_fBuyPrice[2];
	info.m_fBuyPrice[3]		=	pReport->m_fBuyPrice[3];
	info.m_fBuyPrice[4]		=	pReport->m_fBuyPrice[4];
	info.m_fBuyVolume[0]	=	pReport->m_fBuyVolume[0];
	info.m_fBuyVolume[1]	=	pReport->m_fBuyVolume[1];
	info.m_fBuyVolume[2]	=	pReport->m_fBuyVolume[2];
	info.m_fBuyVolume[3]	=	pReport->m_fBuyVolume[3];
	info.m_fBuyVolume[4]	=	pReport->m_fBuyVolume[4];
	info.m_fSellPrice[0]	=	pReport->m_fSellPrice[0];
	info.m_fSellPrice[1]	=	pReport->m_fSellPrice[1];
	info.m_fSellPrice[2]	=	pReport->m_fSellPrice[2];
	info.m_fSellPrice[3]	=	pReport->m_fSellPrice[3];
	info.m_fSellPrice[4]	=	pReport->m_fSellPrice[4];
	info.m_fSellVolume[0]	=	pReport->m_fSellVolume[0];
	info.m_fSellVolume[1]	=	pReport->m_fSellVolume[1];
	info.m_fSellVolume[2]	=	pReport->m_fSellVolume[2];
	info.m_fSellVolume[3]	=	pReport->m_fSellVolume[3];
	info.m_fSellVolume[4]	=	pReport->m_fSellVolume[4];

	// K线数据、日期
	KDATA	kd;
	UpdateKDATAByREPORT( kd, pReport );

	int nLen = info.m_kdata.GetSize();
	if( nLen > 0 && info.m_kdata.ElementAt(nLen-1).m_date == kd.m_date )
		info.m_kdata.SetAt( nLen-1, kd );
	else
		info.m_kdata.Add( kd );
	info.m_datetech	=	kd.m_date;

	// 保存
	memcpy( &(info.m_reportLatest), pReport, sizeof(info.m_reportLatest) );
	return TRUE;
}
开发者ID:amikey,项目名称:tradingstrategyking,代码行数:68,代码来源:Packets.cpp


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