Exemplo n.º 1
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();
	        }

        }