10. KDATA GetAt(int nIndex) const;
void SetAt(int nIndex, KDATA newElement);
KDATA& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const KDATA* GetData() const;
KDATA* GetData();
float MaindataAt(int nIndex) const; // CKData nIndex
BOOL DateAt(int nIndex,
int &nYear, int &nMonth, int &nDay, int &nHour, int &nMinute ) const;
BOOL LatestDate(
int &nYear, int &nMonth, int &nDay, int &nHour, int &nMinute ) const;
DWORD GetDate(int nIndex );
DWORD GetDateDay( int nIndex );
int GetIndexByDate( DWORD date );
int GetAboutIndexByDate( DWORD date );
// Potentially growing the array
void SetAtGrow(int nIndex, KDATA newElement);
int Add(KDATA newElement);
// overloaded operator helpers
KDATA operator[](int nIndex) const;
KDATA& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, KDATA newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CKData* pNewArray);
int InsertKDataSort( KDATA newElement );
// Operation of Analysis
BOOL IsNewValue( int nIndex, BOOL bTopOrBottom, int nDays );
BOOL GetMinMaxInfo( int nStart, int nEnd, float * pfMin, float *pfMax );
// Implementation
public:
virtual ~CKData();
#ifdef _DEBUG
void AssertValid() const;
void Dump() const;
11. #endif
public:
// Extra operations
void SetKType( int ktype );
void AutoSetKType( );
int GetKType( );
int GetCurFormat( );
void SetDRData( CDRData &drdata );
CDRData &GetDRData( );
void ChangeCurFormat( int format, DWORD dateAutoDRBegin, double dAutoDRLimit );
void SetMaindataType( int type );
int GetMaindataType( );
void Clear( );
int CompareLatestDate( CKData &kd );
static int Min5ToMin15( CKData &kdm5, CKData &kdm15 );
static int Min5ToMin30( CKData &kdm5, CKData &kdm30 );
static int Min5ToMin60( CKData &kdm5, CKData &kdm60 );
static int DayToMonth( CKData &kdday, CKData &kdmonth );
static int DayToWeek( CKData &kdday, CKData &kdweek );
DWORD ToDayDate( DWORD date );
int MergeKData( CKData * pother );
int FullFillKData( CKData & kdataMain, BOOL bFillToEnd );
BOOL IsAdjacentDays( int nIndex, int nDays );
BOOL GetDiff( double * pValue, DWORD dateCur, int nDays );
BOOL GetDiffPercent( double * pValue, DWORD dateCur, int nDays );
BOOL GetScope( double * pValue, DWORD dateCur, int nDays );
BOOL GetVolumeSum( double * pValue, DWORD dateCur, int nDays );
BOOL GetRatioVolume( double * pValue, DWORD dateCur, int nDays );
BOOL GetRS( double * pValue, DWORD dateCur, int nDays );
BOOL GetMA( double * pValue, int nIndex, int nDays );
protected:
static int ConvertKData( CKData &kdSrc, CKData &kdDest, int multiple );
void CopyData( const CKData &src );
void LoadDataOriginal( );
void StoreDataOriginal( );
void ConvertXDR( BOOL bUP, DWORD dateAutoDRBegin, double dAutoDRLimit );
static float GetRatio( float fLastClose, DRDATA & dr );
12. protected:
int m_nKType;
int m_nCurFormat;
int m_nCurMaindataType;
CDRData m_drdata;
struct kdata_t * m_pDataOriginal;
int m_nSizeOriginal; // # of elements (upperBound - 1)
int m_nMaxSizeOriginal; // max allocated
struct kdata_t * m_pData;
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
};
/***
*/
class STKLIB_API CBaseData
{
public:
// Construction
CBaseData();
CBaseData( const CBaseData &src );
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
BASEDATA GetAt(int nIndex) const;
void SetAt(int nIndex, BASEDATA newElement);
BASEDATA& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const BASEDATA* GetData() const;
BASEDATA* GetData();
13. // Potentially growing the array
void SetAtGrow(int nIndex, BASEDATA newElement);
int Add(BASEDATA newElement);
// overloaded operator helpers
BASEDATA operator[](int nIndex) const;
BASEDATA& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, BASEDATA newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CBaseData* pNewArray);
int InsertBaseDataSort( BASEDATA newElement );
void Sort( );
CBaseData & operator = ( const CBaseData &src );
void Copy( const CBaseData &src );
// Implementation
protected:
BASEDATA* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CBaseData();
};
/***
*/
class STKLIB_API CReport
{
public:
// Construction
CReport();
CReport( const CReport &src );
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
14. // Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
REPORT GetAt(int nIndex) const;
void SetAt(int nIndex, REPORT newElement);
REPORT& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const REPORT* GetData() const;
REPORT* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, REPORT newElement);
int Add(REPORT newElement);
// overloaded operator helpers
REPORT operator[](int nIndex) const;
REPORT& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, REPORT newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CReport* pNewArray);
int InsertReportSort( REPORT newElement );
void Sort( );
void RemoveDirty( );
CReport & operator = ( const CReport &src );
void Copy( const CReport &src );
BOOL GetMMLD( int nIndex, double *pdVolBuy, double *pdVolSell, double *
pdVolDiff ); //
BOOL GetMMLDMinMaxInfo( double *pdMin, double *pdMax ); //
BOOL StatBuySellEx( float * fSellPrice, float * fSellVolume, float * fBuyPrice, float *
fBuyVolume, int nSize );
// Implementation
protected:
REPORT* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
15. int m_nGrowBy; // grow amount
public:
~CReport();
};
/***
*/
class STKLIB_API CMinute
{
public:
// Construction
CMinute();
CMinute( const CMinute &src );
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
// Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
MINUTE GetAt(int nIndex) const;
void SetAt(int nIndex, MINUTE newElement);
MINUTE& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const MINUTE* GetData() const;
MINUTE* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, MINUTE newElement);
int Add(MINUTE newElement);
// overloaded operator helpers
MINUTE operator[](int nIndex) const;
MINUTE& operator[](int nIndex);
// Operations that move elements around
16. void InsertAt(int nIndex, MINUTE newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, CMinute* pNewArray);
int InsertMinuteSort( MINUTE newElement );
void Sort( );
void RemoveDirty( );
CMinute & operator = ( const CMinute &src );
void Copy( const CMinute &src );
BOOL StatVolumeInfo( double *pdVolNow, double *pdVolOuter, double *pdVolInner );
//
BOOL GetDiffPercentMin5( double * pValue );
BOOL GetLBDKMinMaxInfo( double dVolAverage, double *pdMin, double *pdMax );
//
BOOL GetIndexWave( double *pdWave, int nIndex );
int ToKData( CKData & kdata );
// Implementation
protected:
MINUTE* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~CMinute();
};
/***
*/
class STKLIB_API COutline
{
public:
// Construction
COutline();
COutline( const COutline &src );
// Attributes
int GetSize() const;
int GetUpperBound() const;
void SetSize(int nNewSize, int nGrowBy = -1);
17. // Operations
// Clean up
void FreeExtra();
void RemoveAll();
// Accessing elements
OUTLINE GetAt(int nIndex) const;
void SetAt(int nIndex, OUTLINE newElement);
OUTLINE& ElementAt(int nIndex);
// Direct Access to the element data (may return NULL)
const OUTLINE* GetData() const;
OUTLINE* GetData();
// Potentially growing the array
void SetAtGrow(int nIndex, OUTLINE newElement);
int Add(OUTLINE newElement);
// overloaded operator helpers
OUTLINE operator[](int nIndex) const;
OUTLINE& operator[](int nIndex);
// Operations that move elements around
void InsertAt(int nIndex, OUTLINE newElement, int nCount = 1);
void RemoveAt(int nIndex, int nCount = 1);
void InsertAt(int nStartIndex, COutline* pNewArray);
int InsertOutlineSort( OUTLINE newElement );
void Sort( );
COutline & operator = ( const COutline &src );
void Copy( const COutline &src );
// Implementation
protected:
OUTLINE* m_pData; // the actual array of data
int m_nSize; // # of elements (upperBound - 1)
int m_nMaxSize; // max allocated
int m_nGrowBy; // grow amount
public:
~COutline();
};
class CStDatabase;