Exemplo n.º 1
0
        public override void calculate(DateTime calcDate, FP_Parameter fp_parameter)
        {
            // market data load
            //clsHDAT_MARKETDATA_TB clstb = new clsHDAT_MARKETDATA_TB();

            string calcDateStr = calcDate.ToString("yyyyMMdd");

            //clstb.REF_DT = calcDateStr;
            //clstb.INDEX_CD = this.DAO_.INDEX_CD;

            //int checkNum = clstb.SelectOwn();

            //if (checkNum == 0) { throw new Exception("market data does not exist : " + calcDateStr + " " + clstb.INDEX_CD); }

            //double indexData = clstb.LAST;

            // calculate

            // position
            clsHITM_FP_POSITION_TB position_tb = new clsHITM_FP_POSITION_TB();
            position_tb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;
            position_tb.POSITION_DT = calcDateStr;

            if (position_tb.SelectOwn() == 0) { throw new Exception("position load fail : " + calcDateStr + " " + position_tb.INSTRUMENT_ID); }

            double accountIndex = position_tb.ACCOUNT_INDEX;

            clsHITM_FP_GREEKRESULT_TB result_tb = new clsHITM_FP_GREEKRESULT_TB();

            result_tb.CALC_DT = calcDateStr;

            // price
            result_tb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;

            result_tb.UNDERLYING_ID = "FTP";
            result_tb.UNDERLYING_VALUE = this.DAO_.INDEX_RATE;

            //
            DateTime maturity = ConvertingTool.ToDateTime("21991231");
            double t = (maturity - calcDate).TotalDays / 365;

            result_tb.DELTA = 0.0;
            result_tb.CALC_PRICE = this.DAO_.NOTIONAL;

            result_tb.CALCULATED_FLAG = (int)clsHITM_FP_GREEKRESULT_TB.CALCULATED_FLAG_Type.CALCULATED;
            result_tb.CALCULATED_TIME = DateTime.Now.ToString("HHmmss"); ;
            result_tb.CALCULATE_TYP = (int)clsHITM_FP_GREEKRESULT_TB.CALCULATE_TYP_Type.ANALYTICS;

            result_tb.UpdateDateResult();

            // delta

            // gamma and others : no exist ?
        }
Exemplo n.º 2
0
        // 기존거 있으면 지움. 초기화임.
        public void build_position()
        {
            // 전일자 position date ?
            CalendarManager calendarM = new CalendarManager(this.ReferenceDate_, CalendarManager.CountryType.SOUTH_KOREA);
            DateTime preDate = calendarM.preBusinessDay(this.ReferenceDate_);

            clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();
            clstb_position.POSITION_DT = this.ReferenceDate_.ToString("yyyyMMdd");
            clstb_position.DeleteDate();

            this.build_cashMaster();
            // ------------------------------------------------------------------------

            clsMAST_FP_INSTRUMENT_TB clstb_mast = new clsMAST_FP_INSTRUMENT_TB();

            DataTable dt = clstb_mast.Select();

            List<Financial_instrument> fi_list = new List<Financial_instrument>();

            // master 의 list 내에서 position을 만들음. // bookdate ? 감안해서 만듬?
            foreach (DataRow dr in dt.Select())
            {
                clsMAST_FP_INSTRUMENT_TB tb = clsMAST_FP_INSTRUMENT_TB.Create(dr);
                Financial_instrument fi = Financial_instrument.CreateInstrument(tb);
                fi_list.Add(fi);
            }

            foreach (Financial_instrument fi in fi_list)
            {
                // trading 할때에 같은 날짜는 나중에 더해서 만들어짐
                if (ConvertingTool.ToDateTime(fi.baseDAO_.BOOKED_DT).Date < this.ReferenceDate_.Date)
                { 
                    fi.build_position(preDate, this.ReferenceDate_);
                }
                
            }


        }
Exemplo n.º 3
0
        private void _buildRefDatePosition()
        {
            // if 이미 set이 되면 안함

            clsHITM_FP_POSITION_TB clstb = new clsHITM_FP_POSITION_TB();

            clstb.POSITION_DT = this.refDate_.ToString("yyyyMMdd");

            if ( clstb.Select().Rows.Count == 0 )
            {
                CalendarManager cm = new CalendarManager(this.refDate_, CalendarManager.CountryType.SOUTH_KOREA);

                DateTime roopDate = this.refDate_.AddDays(-1.0);

                while (!cm.isHoliday(roopDate))
                {
                    roopDate = roopDate.AddDays(-1.0);
                }

                this.HedgeTradingViewModel_.FinanceBook_.makePositionFromPreDate(roopDate,this.refDate_);

            }

        }
Exemplo n.º 4
0
        public void position_calculate(DateTime refDate)
        {
            // 계산 된 결과를 

            // 포지션에 update침

            //List<Position> positionList = new List<Position>();


            clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();

            clstb_position.POSITION_DT = refDate.ToString("yyyyMMdd");

            DataTable dt = clstb_position.Select();

            foreach (DataRow dr in dt.Select())
            {
                Position p = Position.CreatePosition(clsHITM_FP_POSITION_TB.Create(dr));

                p.calculatePL();
            }


        }
Exemplo n.º 5
0
        public void build_position(DateTime preDate, DateTime nextDate)
        {
            // 
            clsHITM_FP_POSITION_TB clstb = new clsHITM_FP_POSITION_TB();

            clstb.POSITION_DT = preDate.ToString("yyyyMMdd");
            clstb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;

            //if (clstb.SelectOwn() == 0)
            //{
                //throw new Exception("no exist position : " + this.baseDAO_.INSTRUMENT_ID);
                
            //}
            
            // 없는게 말이 안됨... Trade 할때 Position이 박히거든...

            // Direct로 Master에 밀어 넣는건 안됨.

            // 없으면 없는 건데.. trade된거는 다음 Process 임. 엎어 치던 더하던, 이건 기존꺼만 함.

            if ( clstb.SelectOwn() != 0)
            { 
                Position ifp = Position.CreatePosition(clstb);
                ifp.DAO_ = clstb;
                Position next_date_ifp = ifp.nextDateClone(nextDate);

                next_date_ifp.DAO_.Insert();
            }

            //return next_date_ifp;
        }
Exemplo n.º 6
0
        public void moveInstrumentToThis(clsMAST_FP_INSTRUMENT_TB clstb)
        {
            // book change
            clstb.BOOK_CD = this.bookCode_;

            if (clstb.UpdateBook() != 1)
                { throw new Exception("move instrument fail : " + clstb.INSTRUMENT_NM); }


            // position change
            clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();

            clstb_position.BOOK_CD = this.bookCode_;
            clstb_position.INSTRUMENT_ID = clstb.INSTRUMENT_ID;

            if (clstb_position.UpdateBookChange() == 0)
                { throw new Exception("0 position is moved : " + clstb.INSTRUMENT_NM); }


        }
Exemplo n.º 7
0
        public void totalPositionLoad()
        {
            this.LoadedPositionDAOList_.Clear();

            // sub book 에 대한 검사.

            clsHITM_FP_POSITION_TB clstb = new clsHITM_FP_POSITION_TB();

            //clstb.BOOK_CD = book_cd;
            clstb.POSITION_DT = this.ReferenceDate_.ToString("yyyyMMdd");

            DataTable dt = clstb.Select();

            foreach (DataRow dr in dt.Select())
            {
                this.LoadedPositionDAOList_.Add(clsHITM_FP_POSITION_TB.Create(dr));
            }
        }
Exemplo n.º 8
0
		public clsHITM_FP_POSITION_TB Clone()
		{
			try
			{
				clsHITM_FP_POSITION_TB cloneTB = new clsHITM_FP_POSITION_TB();
				
				
				cloneTB._POSITION_ID = this._POSITION_ID;
				cloneTB._FP_MASTER_TYP = this._FP_MASTER_TYP;
				cloneTB._POSITION_DT = this._POSITION_DT;
				cloneTB._BOOK_CD = this._BOOK_CD;
				cloneTB._INSTRUMENT_ID = this._INSTRUMENT_ID;
				cloneTB._INSTRUMENT_QNT = this._INSTRUMENT_QNT;
				cloneTB._EVAL_CURR = this._EVAL_CURR;
				cloneTB._CURR_RATE = this._CURR_RATE;
				cloneTB._NOTIONAL_AMT = this._NOTIONAL_AMT;
				cloneTB._ACCOUNT_AMT = this._ACCOUNT_AMT;
				cloneTB._ACCOUNT_UNIT = this._ACCOUNT_UNIT;
				cloneTB._ACCOUNT_INDEX = this._ACCOUNT_INDEX;
				cloneTB._EVAL_AMT = this._EVAL_AMT;
				cloneTB._EVAL_PRICE = this._EVAL_PRICE;
				cloneTB._EVAL_ACCOUNT_PL = this._EVAL_ACCOUNT_PL;
				cloneTB._TRADE_PROFIT = this._TRADE_PROFIT;
				cloneTB._TRADE_LOSS = this._TRADE_LOSS;
				cloneTB._TRADE_TOTAL = this._TRADE_TOTAL;
				cloneTB._TRANSACTION_FEE = this._TRANSACTION_FEE;
				cloneTB._ETC_PL = this._ETC_PL;
				cloneTB._TOTAL_ACCOUNT_PL = this._TOTAL_ACCOUNT_PL;
				cloneTB._DAILY_EVAL_PL = this._DAILY_EVAL_PL;
				cloneTB._DAILY_TOTAL_PL = this._DAILY_TOTAL_PL; 
				
				return cloneTB;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
Exemplo n.º 9
0
		public static clsHITM_FP_POSITION_TB Create(DataRow dr)
		{
			try
			{
				clsHITM_FP_POSITION_TB tb = new clsHITM_FP_POSITION_TB();
				
				
				tb._POSITION_ID = Convert.ToString(dr[0]);
				tb._FP_MASTER_TYP = Convert.ToInt32(dr[1]);
				tb._POSITION_DT = Convert.ToString(dr[2]);
				tb._BOOK_CD = Convert.ToString(dr[3]);
				tb._INSTRUMENT_ID = Convert.ToString(dr[4]);
				tb._INSTRUMENT_QNT = Convert.ToDouble(dr[5]);
				tb._EVAL_CURR = Convert.ToString(dr[6]);
				tb._CURR_RATE = Convert.ToDouble(dr[7]);
				tb._NOTIONAL_AMT = Convert.ToDouble(dr[8]);
				tb._ACCOUNT_AMT = Convert.ToDouble(dr[9]);
				tb._ACCOUNT_UNIT = Convert.ToDouble(dr[10]);
				tb._ACCOUNT_INDEX = Convert.ToDouble(dr[11]);
				tb._EVAL_AMT = Convert.ToDouble(dr[12]);
				tb._EVAL_PRICE = Convert.ToDouble(dr[13]);
				tb._EVAL_ACCOUNT_PL = Convert.ToDouble(dr[14]);
				tb._TRADE_PROFIT = Convert.ToDouble(dr[15]);
				tb._TRADE_LOSS = Convert.ToDouble(dr[16]);
				tb._TRADE_TOTAL = Convert.ToDouble(dr[17]);
				tb._TRANSACTION_FEE = Convert.ToDouble(dr[18]);
				tb._ETC_PL = Convert.ToDouble(dr[19]);
				tb._TOTAL_ACCOUNT_PL = Convert.ToDouble(dr[20]);
				tb._DAILY_EVAL_PL = Convert.ToDouble(dr[21]);
				tb._DAILY_TOTAL_PL = Convert.ToDouble(dr[22]); 
				
				return tb;
			}
			catch(Exception ex)
			{
				throw new Exception(ex.Message);
			}
		}
Exemplo n.º 10
0
        public override void calculate(DateTime calcDate,FP_Parameter fp_parameter)
        {
            // market data load
            clsHDAT_MARKETDATA_TB clstb = new clsHDAT_MARKETDATA_TB();

            string calcDateStr = calcDate.ToString("yyyyMMdd");

            clstb.REF_DT = calcDateStr;
            clstb.INDEX_CD = this.indexFuturesDAO_.UNDERLYING_INDEX_CD;

            int checkNum = clstb.SelectOwn();

            if (checkNum == 0) { throw new Exception("market data does not exist : " + calcDateStr + " " + clstb.INDEX_CD); }

            double indexData = clstb.LAST;

            // calculate
            
            // position
            clsHITM_FP_POSITION_TB position_tb = new clsHITM_FP_POSITION_TB();
            position_tb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;
            position_tb.POSITION_DT = calcDateStr;

            if (position_tb.SelectOwn() == 0) { throw new Exception("position load fail : " + calcDateStr + " " + position_tb.INSTRUMENT_ID); } 

            double accountIndex = position_tb.ACCOUNT_INDEX;

            clsHITM_FP_GREEKRESULT_TB result_tb = new clsHITM_FP_GREEKRESULT_TB();

            result_tb.CALC_DT = calcDateStr;

            // price
            result_tb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;

            result_tb.UNDERLYING_ID = this.indexFuturesDAO_.UNDERLYING_INDEX_CD;
            result_tb.UNDERLYING_VALUE = indexData;
            
            //
            DateTime maturity = ConvertingTool.ToDateTime(this.indexFuturesDAO_.MATURITY_DT);
            double t = (maturity - calcDate).TotalDays / 365;

            result_tb.DELTA = Math.Round(this.indexFuturesDAO_.QUANTITY * indexData * this.indexFuturesDAO_.INDEX_MULTIPLIER 
                            * Math.Exp(0.03 * t));

            result_tb.CALC_PRICE = Math.Round( this.indexFuturesDAO_.QUANTITY * 
                                    ( indexData - accountIndex ) * 
                                    this.indexFuturesDAO_.INDEX_MULTIPLIER );

            result_tb.CALCULATED_FLAG = (int)clsHITM_FP_GREEKRESULT_TB.CALCULATED_FLAG_Type.CALCULATED;
            result_tb.CALCULATED_TIME = DateTime.Now.ToString("HHmmss"); ;
            result_tb.CALCULATE_TYP = (int)clsHITM_FP_GREEKRESULT_TB.CALCULATE_TYP_Type.ANALYTICS;

            //result_tb.UpdateDateResult();
            result_tb.Insert();

            // delta
            // gamma and others : no exist ?

        }
Exemplo n.º 11
0
        public void position_calculate(DateTime refDate)
        {
            // 계산 된 결과를 
            // 포지션에 update침

            updateBatchJobID_start(refDate, clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.POSITION_CALCULATION);

            clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();

            clstb_position.POSITION_DT = refDate.ToString("yyyyMMdd");

            DataTable dt = clstb_position.Select();

            foreach (DataRow dr in dt.Select())
            {
                Position p = Position.CreatePosition(clsHITM_FP_POSITION_TB.Create(dr));

                p.calculatePL();
            }

            updateBatchJobID_end(refDate, clsHDAT_BATCHJOB_RESULT_TB.BATCH_JOB_ID_Type.POSITION_CALCULATION);
        }
Exemplo n.º 12
0
        // #CreatePosition_ItemAdd 
        public static Position CreatePosition(clsHITM_FP_POSITION_TB clsTB)
        {
            int type = clsTB.FP_MASTER_TYP;

            DateTime referenceDate = ConvertingTool.ToDateTime(clsTB.POSITION_DT);

            if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Kospi200_IndexFutures)
            {
                return new IndexFututuesPosition() 
                { 
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB ,
                    Financial_instrument_ = new Kospi200Index_futures()
                };
            }

            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Kospi200_IndexOption_Call 
                  || type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Kospi200_IndexOption_Put)
            {
                return new IndexOptionPosition () 
                {
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB ,
                    Financial_instrument_ = new Kospi200Index_option()
                };
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.VanillaIRS)
            {
                return new VanillaIRSPosition() 
                {
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB, 
                    Financial_instrument_ = new VanillaIRS_instrument()
                };
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Ftp_DepositLoan)
            {
                return new Ftp_DepositLoanPosition()
                {
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB,
                    Financial_instrument_ = new Ftp_DepositLoan()
                };
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Money_Cash)
            {
                return new CurrencyCashPosition()
                {
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB,
                    Financial_instrument_ = new CurrencyCash()
                };
            }

            else
            {
                return new UnknownTypePosition() 
                {
                    ReferenceDateTime_ = referenceDate,
                    DAO_ = clsTB 
                };
            }
        }
Exemplo n.º 13
0
        public void calculatePL()
        {
            CalendarManager cm = new CalendarManager(this.ReferenceDateTime_, CalendarManager.CountryType.SOUTH_KOREA);

            clsHITM_FP_GREEKRESULT_TB clstb_result = new clsHITM_FP_GREEKRESULT_TB();

            clstb_result.CALC_DT = this.ReferenceDateTime_.ToString("yyyyMMdd");
            clstb_result.INSTRUMENT_ID = this.DAO_.INSTRUMENT_ID;
            clstb_result.SEQ = 1;

            int checkNum = clstb_result.SelectOwn();

            if (checkNum == 0) { throw new Exception("no exist"); }

            double calcPrice = clstb_result.CALC_PRICE;
            double quantity = this.DAO_.INSTRUMENT_QNT;

            clsMAST_FP_INSTRUMENT_TB clstb_master = new clsMAST_FP_INSTRUMENT_TB();

            //this.DAO_.ETC_PL = clstb_result.CALC_PRICE;

            this.DAO_.EVAL_AMT = Math.Round( calcPrice );
            this.DAO_.EVAL_PRICE = Math.Round( calcPrice / quantity );
            this.DAO_.EVAL_ACCOUNT_PL = Math.Round( this.DAO_.EVAL_AMT - this.DAO_.ACCOUNT_AMT ); // - 평가금액 - 장부금액
            //this.DAO_.TRADE_PROFIT = this.DAO_.TRADE_PROFIT + tradePosition.DAO_.TRADE_PROFIT; // 일별 매매수익
            //this.DAO_.TRADE_LOSS = tradePosition.DAO_.TRADE_LOSS;
            //this.DAO_.TRADE_TOTAL = tradePosition.DAO_.TRADE_TOTAL;
            //this.DAO_.TRANSACTION_FEE = tradePosition.DAO_.TRANSACTION_FEE;
            this.DAO_.ETC_PL = 0; // 데일리 기타 손익임.
            this.DAO_.TOTAL_ACCOUNT_PL = Math.Round( this.DAO_.EVAL_ACCOUNT_PL + this.DAO_.TRADE_TOTAL + this.DAO_.TRANSACTION_FEE );

            // 전일 포지션 
            DateTime preDate = cm.preBusinessDay(ConvertingTool.ToDateTime(this.ReferenceDateTime_.ToString("yyyyMMdd")));

            clsHITM_FP_POSITION_TB clstb_position = new clsHITM_FP_POSITION_TB();

            clstb_position.POSITION_DT = preDate.ToString("yyyyMMdd");
            clstb_position.INSTRUMENT_ID = this.DAO_.INSTRUMENT_ID;

            clstb_position.SelectOwn();

            // 전일자꺼가 여기 박혀서 옴..? 중간에 trade했을때
            this.DAO_.DAILY_EVAL_PL = Math.Round(this.DAO_.EVAL_AMT - clstb_position.EVAL_AMT ); // 전일 평가 - 당일 평가
            this.DAO_.DAILY_TOTAL_PL = Math.Round( this.DAO_.TRADE_TOTAL + this.DAO_.ETC_PL + this.DAO_.DAILY_EVAL_PL );

            // 여기서 부터 작업

            this.calculatePL_impl();

            if (this.DAO_.UpdateCalculatedPosition() == 0)
            { throw new Exception("update fail :" + this.DAO_.INSTRUMENT_ID + " " + this.DAO_.POSITION_DT); }
            else if (this.DAO_.UpdateCalculatedPosition() > 1)
            { throw new Exception("too many updated :" + this.DAO_.INSTRUMENT_ID + " " + this.DAO_.POSITION_DT); }
            else { }
        }
Exemplo n.º 14
0
        public void build_cashPosition(DateTime refDate)
        {
            clsHITM_CASH_INSTOCK_TB clstb_cash = new clsHITM_CASH_INSTOCK_TB();

            DataTable dt = clstb_cash.SelectCashesInEachBook(this.baseDAO_.BOOK_CD);

            clsHITM_FP_POSITION_TB clstb = new clsHITM_FP_POSITION_TB();

            foreach ( DataRow dr in dt.Select() )
	        {
                clsHITM_CASH_INSTOCK_TB tb_cash = clsHITM_CASH_INSTOCK_TB.Create(dr);

                clstb.POSITION_ID = IDGenerator.getNewPositionID(this.baseDAO_.INSTRUMENT_ID, refDate.ToString("yyyyMMdd"));
                clstb.FP_MASTER_TYP = this.baseDAO_.FP_MASTER_TYP;
                clstb.POSITION_DT = refDate.ToString("yyyyMMdd");
                clstb.BOOK_CD = this.baseDAO_.BOOK_CD;
                clstb.INSTRUMENT_ID = this.baseDAO_.INSTRUMENT_ID;
                clstb.INSTRUMENT_QNT = tb_cash.CASHFLOW;
                clstb.EVAL_CURR = tb_cash.CURR;
                clstb.CURR_RATE = 1.0;//tb_cash.CURR_RATE;
                clstb.NOTIONAL_AMT = tb_cash.CASHFLOW;
                clstb.ACCOUNT_AMT = tb_cash.CASHFLOW_DOMESTIC;
                clstb.ACCOUNT_UNIT = 0.0;
                clstb.ACCOUNT_INDEX = 0.0;
                clstb.EVAL_AMT = 0.0;
                clstb.EVAL_PRICE = 0.0;
                clstb.EVAL_ACCOUNT_PL = 0.0;
                clstb.TRADE_PROFIT = 0.0;
                clstb.TRADE_LOSS = 0.0;
                clstb.TRADE_TOTAL = 0.0;
                clstb.TRANSACTION_FEE = 0.0;
                clstb.ETC_PL = 0.0;
                clstb.TOTAL_ACCOUNT_PL = 0.0;
                clstb.DAILY_EVAL_PL = 0.0;
                clstb.DAILY_TOTAL_PL = 0.0;

                clstb.Insert();
	        }

        }
Exemplo n.º 15
0
        private static void test()
        {
            DateTime startDate = new DateTime(2014, 1, 1);
            DateTime endDate = DateTime.Now.AddDays(-1.0).Date;
            SampleMarketDataETL sample_etl = new SampleMarketDataETL();

            HDAT_MARKETDATA_TB marketdata_tb = new HDAT_MARKETDATA_TB();
            clsHDAT_MARKETDATA_TB.TableClear();

            HDAT_CURVEDATA_TB curvedata_tb = new HDAT_CURVEDATA_TB();
            clsHDAT_CURVEDATA_TB.TableClear();

            sample_etl.build_historyData(startDate, endDate, true);

            {
                //HDAT_MARKETDATA_TB marketdata_tb = new HDAT_MARKETDATA_TB();
                //clsHDAT_MARKETDATA_TB.TableClear();
                //marketdata_tb.buildTestData();

                clsHITM_TRADEINFO_TB trade_tb = new clsHITM_TRADEINFO_TB();
                clsHITM_TRADEINFO_TB.TableClear();

                clsMAST_FP_INSTRUMENT_TB mast_tb = new clsMAST_FP_INSTRUMENT_TB();
                clsMAST_FP_INSTRUMENT_TB.TableClear();

                clsHITM_FP_POSITION_TB position_tb = new clsHITM_FP_POSITION_TB();
                clsHITM_FP_POSITION_TB.TableClear();

                curvedata_tb.buildTestData();

                SET_DISCOUNTCURVE_TB discount_tb = new SET_DISCOUNTCURVE_TB();
                clsSET_DISCOUNTCURVE_TB.TableClear();
                discount_tb.buildTestData();

                HITM_CALENDAR_TB calendar_tb = new HITM_CALENDAR_TB();
                clsHITM_CALENDAR_TB.TableClear();
                calendar_tb.buildTestData();



            }

        }