//---------------------------------------------------------------------------
#ifndef commonH
#define commonH
//---------------------------------------------------------------------------
#define MAX_PATH            0xFF
#define MAX_NAME            0xFF

#define NO_PLUGIN           0xFF

#define TF_TIKS             1
#define TF_MIN1             2
#define TF_MIN5             3
#define TF_MIN10            4
#define TF_MIN15            5
#define TF_MIN30            6
#define TF_MIN60            7
#define TF_HOUR             8
#define TF_DAY              9
#define TF_WEEK             10
#define TF_MONTH            11
#define TF_HOUR4            12

#define PLG_SRC             101
#define PLG_SRC_OK          1
#define SRC_CHKT            1
#define SRC_DOWN            2
#define SRC_CONFIG          3
#define SRC_TICKERS         4

#define PLG_FMT             102
#define PLG_FMT_OK          1
#define FMT_CONFIG          1
#define FMT_RENAME          2
#define FMT_DELETE          3
#define FMT_PERIOD          4
#define FMT_TICKERS         5
#define FMT_SER_ADD         6
#define FMT_SER_SET         7
#define FMT_SER_GET         8
#define FMT_SER_GETex       9
#define FMT_SER_SETex       10
//---------------------------------------------------------------------------

typedef unsigned char  uchar;
typedef unsigned short ushort;
typedef unsigned long  ulong;

#pragma pack(push,1)

typedef struct{
	char*         sGroupName;
	char*         sDirectory;
	char*         sSource;
	char*	      sPlatform;
	char*         sFormat;

	uchar         uSource;
	uchar         uPlatform;
	uchar         uTimeFrame;
	uchar         uFormat;

	ulong         uCountStock;
	uchar         bChecked;
} SET_GROUP;

typedef struct{
	char          sTicker[MAX_NAME];
	char          sInfo[MAX_NAME];
} SET_STOCK;

typedef struct{
	int           Count;
	double*       pDate;
	float*        pfOpen;
	float*        pfHigh;
	float*        pfLow;
	float*        pfClose;
	float*        pfVolume;
	float*        pfOpInt;
} SERIES;

typedef struct{
	int           Count;
	char**        sName;
} LST_TICKERS;


typedef struct{
	uchar         uType;
	char*         sName;
	uchar         uSecCount;
	char**        sSections;
	uchar         uTfCount;
	uchar*        pTimeFrames;
	uchar         bConfig;
	uchar         bTickers;
} PLG_SRC_INF;

typedef struct{
	SET_GROUP*    group;
	SET_STOCK*    stock;
	double        dt1;
	double        dt2;
} PLG_SRC_DATA;


typedef struct{
	uchar         uType;
	char*         sName;
	char*         sFilter;
	uchar         bConfig;
} PLG_FMT_INF;

typedef struct{
	char          sDir[MAX_PATH];
	char          sName[MAX_NAME];
	double        dt1;
	double        dt2;
	void*         pd;
} PLG_FMT_DATA;


#pragma pack(pop)

//---------------------------------------------------------------------------
#endif
