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


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

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


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

示例1: StoreKData

BOOL CSetKDataDlg::StoreKData( CString strStockCode )
{
	if( strStockCode.GetLength() <= 0 )
		return FALSE;

	UpdateData( );

	if( m_tmDate.GetTime() == -1 )
		return FALSE;

	if( !IsNumber(m_strOpen,FALSE) || !IsNumber(m_strHigh,FALSE) || !IsNumber(m_strLow,FALSE)
		|| !IsNumber(m_strClose,FALSE) )
	{
		AfxMessageBox( IDS_SETKDATA_NOTNUMBER );
		return FALSE;
	}

	DWORD dwMarket = CStock::marketUnknown;
	CStockInfo info;
	if( info.SetStockCode(dwMarket, strStockCode) )
		dwMarket = info.GetMarket();
	
	int nKType = m_comboKType.GetSelect();

	CSPTime sptime = m_tmDate.GetTime();
	KDATA kd;
	memset( &kd, 0, sizeof(kd) );
	kd.m_dwMarket = dwMarket;
	strncpy( kd.m_szCode, strStockCode, min(sizeof(kd.m_szCode)-1,strStockCode.GetLength()) );
	kd.m_time = m_tmDate.GetTime();
	kd.m_date = sptime.ToStockTime(CKData::IsDayOrMin(nKType));
	kd.m_fOpen	=	(float)atof(m_strOpen);
	kd.m_fHigh	=	(float)atof(m_strHigh);
	kd.m_fLow		=	(float)atof(m_strLow);
	kd.m_fClose	=	(float)atof(m_strClose);
	kd.m_fVolume	=	(float)m_dwVolume*100;
	kd.m_fAmount	=	(float)m_dwAmount*1000;

	CKData kdata(nKType);
	kdata.Add( kd );
	AfxGetDB().InstallKData( kdata );

	return TRUE;
}
开发者ID:darwinbeing,项目名称:trade,代码行数:44,代码来源:SetKDataDlg.cpp

示例2: ResolveTypeAndMarket

void CStockInfo::ResolveTypeAndMarket( )
{
	CStockInfo	info;
	if( AfxGetStockContainer().GetStockInfo( m_szCode, &info )
		&& CStock::typeNone != info.GetType()
		&& CStock::marketUnknown != info.GetMarket() )
	{
		if( CStock::typeNone == m_type )
			m_type = info.GetType();
		if( CStock::marketUnknown == m_dwMarket )
			m_dwMarket = info.GetMarket();
		return;
	}

	long	type = CStock::typeNone;
	DWORD	dwMarket = CStock::marketUnknown;
	if( strlen(m_szCode) > 0 )
	{
		if( strcmp(m_szCode,"000001") >= 0 && strcmp(m_szCode,"000999") <= 0 )		// 深圳A股
		{	type = CStock::typeszA;			dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"002001") >= 0 && strcmp(m_szCode,"002999") <= 0 )	// 深圳A股(中小企业)
		{	type = CStock::typeszA;			dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"200001") >= 0 && strcmp(m_szCode,"200999") <= 0 )	// 深圳B股
		{	type = CStock::typeszB;			dwMarket = CStock::marketSZSE;	}
		else if( strncmp(m_szCode,"600",3) == 0 )	// 上海A股
		{	type = CStock::typeshA;			dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"500",3) == 0 )	// 上海基金
		{	type = CStock::typeshA;			dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"900",3) == 0 )	// 上海B股
		{	type = CStock::typeshB;			dwMarket = CStock::marketSHSE;	}

		else if( strcmp(m_szCode,"001001") >= 0 && strcmp(m_szCode,"001199") <= 0 )	// 深圳企业债券
		{	type = CStock::typeszBond;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"001200") >= 0 && strcmp(m_szCode,"001899") <= 0 )	// 深圳国债回购
		{	type = CStock::typeszBond;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"001900") >= 0 && strcmp(m_szCode,"001999") <= 0 )	// 深圳国债现货
		{	type = CStock::typeszBond;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"002600") >= 0 && strcmp(m_szCode,"002999") <= 0 )	// 深圳B股权证
		{	type = CStock::typeszRight;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"003001") >= 0 && strcmp(m_szCode,"003999") <= 0 )	// 深圳转配认购
		{	type = CStock::typeszAdmeasure;	dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"009001") >= 0 && strcmp(m_szCode,"009999") <= 0 )	// 深圳新股配售
		{	type = CStock::typeszAdmeasure;	dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"005001") >= 0 && strcmp(m_szCode,"005999") <= 0 )	// 深圳可转换债券
		{	type = CStock::typeszBond;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"006001") >= 0 && strcmp(m_szCode,"006999") <= 0 )	// 深圳国债期货
		{	type = CStock::typeszBond;		dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"004601") >= 0 && strcmp(m_szCode,"004699") <= 0 )	// 深圳证券投资基金
		{	type = CStock::typeszA;			dwMarket = CStock::marketSZSE;	}
		else if( strcmp(m_szCode,"008001") >= 0 && strcmp(m_szCode,"008999") <= 0 )	// 深圳配股认购
		{	type = CStock::typeszAdmeasure;	dwMarket = CStock::marketSZSE;	}


		else if( strncmp(m_szCode,"001",3) == 0 )	// 上海国债现货
		{	type = CStock::typeshBond;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"110",3) == 0 || strncmp(m_szCode,"120",3) == 0 )	// 上海企业债券
		{	type = CStock::typeshBond;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"310",3) == 0 )	// 上海国债期货
		{	type = CStock::typeshBond;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"580",3) == 0 || strncmp(m_szCode,"582",3) == 0 )	// 上海权证
		{	type = CStock::typeshRight;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"710",3) == 0 )	// 上海转配股
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"711",3) == 0 )	// 上海转配股再转配股
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"730",3) == 0 )	// 上海新股申购
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"737",3) == 0 )	// 上海新股配售
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"201",3) == 0 )	// 上海国债回购	
		{	type = CStock::typeshBond;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"129",3) == 0 || strncmp(m_szCode,"100",3) == 0 )	// 上海可转换债券
		{	type = CStock::typeshBond;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"700",3) == 0 )	// 上海配股
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"701",3) == 0 )	// 上海转配股再配股
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"720",3) == 0 )	// 上海红利
		{	type = CStock::typeshBonus;		dwMarket = CStock::marketSHSE;	}
		else if( strncmp(m_szCode,"735",3) == 0 )	// 上海新基金申购
		{	type = CStock::typeshAdmeasure;	dwMarket = CStock::marketSHSE;	}
	}

	if( CStock::typeNone == m_type )
		m_type		= type;
	if( CStock::marketUnknown == m_dwMarket )
		m_dwMarket	= dwMarket;
}
开发者ID:ZhaoboMeng,项目名称:k-line-print,代码行数:88,代码来源:Stock.cpp


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