Example #1
0
BOOL CStockContainer::GetLatestTechDate( DWORD * pdwDate )
{
	CStockInfo	info;
	if( GetStockInfo( STKLIB_CODE_MAIN, &info )
		&& info.m_kdata.GetSize() > 0 )
	{
		*pdwDate	=	info.m_kdata.ElementAt(info.m_kdata.GetSize()-1).m_date;
		return TRUE;
	}
	return FALSE;
}
Example #2
0
BOOL CStockContainer::GetTechDateArray( CSPDWordArray & dwArray )
{
	CStockInfo	info;
	if( GetStockInfo( STKLIB_CODE_MAIN, &info ) )
	{
		dwArray.SetSize( 0, info.m_kdata.GetSize()+10 );
		for( int i=0; i<info.m_kdata.GetSize(); i++ )
			dwArray.Add( info.m_kdata.ElementAt(i).m_date );
		return TRUE;
	}
	return FALSE;
}
Example #3
0
BOOL CStockContainer::SetCurrentStock( const char * szCode )
{
	CSPMutex::Scoped	l(m_mutex);

	int	nStockIndex	=	-1;
	CStockInfo	info;
	if( GetStockInfo( szCode, &info, &nStockIndex ) )
		return SetCurrentStock( nStockIndex );
	else
	{
		m_nCurrentStock			=	-1;
		m_strCurrentStockCode	=	szCode;
		return FALSE;
	}
}
void CHyperFeedStructureInfo::OnRequest(CRequestBasePtr pRequest)
{
	EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("OnRequest Enter"));	
	switch(pRequest->m_enType)
	{
	case _enRequestStock:
		{
			CStockRequest* pStockRequest = dynamic_cast<CStockRequest*>(pRequest.get());
			EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Requesting Stock Start"));	
			if(pStockRequest)
			{
				EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Get stock info call"));	
				GetStockInfo(pStockRequest->m_recParams);
			}
			EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Requesting Stock Done: %s"), _T(pStockRequest->m_recParams->Stock));	
		}
		break;
	case _enRequestOption:
		{
			EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Requesting Option Start"));	
			
			COptionRequest* pOptionRequest = dynamic_cast<COptionRequest*>(pRequest.get());

			if(pOptionRequest)
			{
				pOptionRequest->m_recParams.CopyTo(m_vtCurrentRequest);
//				if(!IsCanceled())
//				{
//					EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Requesting Option Fundamental Call: %s"), _T(pOptionRequest->m_recParams->UnderlyingSymbol));	
//					LoadOptionFundamentalInfo(pOptionRequest->m_recParams->UnderlyingSymbol);
//				}
					
				if(!IsCanceled())
				{
					EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("GetOptions Call: %s"), _T(pOptionRequest->m_recParams->UnderlyingSymbol));	
					GetOptions(pOptionRequest->m_recParams->UnderlyingSymbol);
				}
				
			}
			EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("Requesting Option Done"));	
		}
		break;
	}
	EgLib::CEgLibTraceManager::Trace(LogSubs, __FUNCTION__ , _T("OnRequest Exit"));	
}