Example #1
0
        public override void cumulatePosition(Position tradePosition)
        {
            //this.DAO_.POSITION_ID = tradePosition.DAO_.POSITION_ID;
            //this.DAO_.POSITION_TYP = tradePosition.DAO_.POSITION_TYP;
            //this.DAO_.POSITION_DT = tradePosition.DAO_.POSITION_DT;
            //this.DAO_.INSTRUMENT_ID = tradePosition.DAO_.INSTRUMENT_ID;
            this.DAO_.INSTRUMENT_QNT = this.DAO_.INSTRUMENT_QNT + tradePosition.DAO_.INSTRUMENT_QNT;
            //this.DAO_.EVAL_CURR = tradePosition.DAO_.EVAL_CURR;
            //this.DAO_.CURR_RATE = tradePosition.DAO_.CURR_RATE;
            this.DAO_.NOTIONAL_AMT = tradePosition.DAO_.NOTIONAL_AMT;
            this.DAO_.ACCOUNT_AMT = tradePosition.DAO_.ACCOUNT_AMT;
            this.DAO_.ACCOUNT_UNIT = tradePosition.DAO_.ACCOUNT_UNIT;
            this.DAO_.EVAL_AMT = tradePosition.DAO_.EVAL_AMT;
            this.DAO_.EVAL_PRICE = tradePosition.DAO_.EVAL_PRICE;
            this.DAO_.EVAL_ACCOUNT_PL = tradePosition.DAO_.EVAL_ACCOUNT_PL;
            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 = tradePosition.DAO_.ETC_PL;
            this.DAO_.TOTAL_ACCOUNT_PL = tradePosition.DAO_.TOTAL_ACCOUNT_PL;
            this.DAO_.DAILY_EVAL_PL = tradePosition.DAO_.DAILY_EVAL_PL;
            this.DAO_.DAILY_TOTAL_PL = tradePosition.DAO_.DAILY_TOTAL_PL;

        }
Example #2
0
        public override void cumulatePosition(Position tradePosition)
        {
            //this.DAO_.POSITION_ID = tradePosition.DAO_.POSITION_ID;
            //this.DAO_.POSITION_TYP = tradePosition.DAO_.POSITION_TYP;
            //this.DAO_.POSITION_DT = tradePosition.DAO_.POSITION_DT;
            //this.DAO_.INSTRUMENT_ID = tradePosition.DAO_.INSTRUMENT_ID;
            this.DAO_.INSTRUMENT_QNT = this.DAO_.INSTRUMENT_QNT + tradePosition.DAO_.INSTRUMENT_QNT;
            //this.DAO_.EVAL_CURR = tradePosition.DAO_.EVAL_CURR;
            //this.DAO_.CURR_RATE = tradePosition.DAO_.CURR_RATE;
            this.DAO_.NOTIONAL_AMT = this.DAO_.NOTIONAL_AMT + tradePosition.DAO_.NOTIONAL_AMT;
            //this.DAO_.ACCOUNT_AMT = this.DAO_.ACCOUNT_AMT + tradePosition.DAO_.ACCOUNT_AMT;
            this.DAO_.ACCOUNT_AMT = 0.0;

            //this.DAO_.ACCOUNT_UNIT = tradePosition.DAO_.NOTIONAL_AMT / this.DAO_.INSTRUMENT_QNT; // - 장부 인덱스
            this.DAO_.ACCOUNT_UNIT = 0.0;
            this.DAO_.ACCOUNT_INDEX = (this.DAO_.ACCOUNT_INDEX * this.DAO_.INSTRUMENT_QNT +
                                        tradePosition.DAO_.ACCOUNT_INDEX * tradePosition.DAO_.INSTRUMENT_QNT) /
                                        (this.DAO_.INSTRUMENT_QNT + tradePosition.DAO_.INSTRUMENT_QNT);

            this.DAO_.EVAL_AMT = this.DAO_.EVAL_AMT + tradePosition.DAO_.EVAL_AMT; // 차후 업어쳐질거임

            this.DAO_.EVAL_PRICE = tradePosition.DAO_.EVAL_AMT / this.DAO_.INSTRUMENT_QNT; ; // - 평가금액 / 수량

            this.DAO_.EVAL_ACCOUNT_PL = this.DAO_.EVAL_PRICE - 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 = tradePosition.DAO_.ETC_PL;
            this.DAO_.TOTAL_ACCOUNT_PL = tradePosition.DAO_.TOTAL_ACCOUNT_PL;
            this.DAO_.DAILY_EVAL_PL = tradePosition.DAO_.DAILY_EVAL_PL;
            this.DAO_.DAILY_TOTAL_PL = tradePosition.DAO_.DAILY_TOTAL_PL;

        }
Example #3
0
        protected void nextDatepositionBaseCopy(Position position, DateTime nextDate)
        {
            position.Financial_instrument_ = this.Financial_instrument_;

            position.DAO_ = new DatabaseLayer.clsHITM_FP_POSITION_TB();
            position.ReferenceDateTime_ = nextDate;

            position.DAO_.POSITION_ID = IDGenerator.getNewPositionID(this.DAO_.INSTRUMENT_ID, nextDate.ToString("yyyyMMdd"));
            position.DAO_.FP_MASTER_TYP = this.DAO_.FP_MASTER_TYP;
            position.DAO_.POSITION_DT = nextDate.ToString("yyyyMMdd");
            position.DAO_.INSTRUMENT_ID = this.DAO_.INSTRUMENT_ID;
            position.DAO_.INSTRUMENT_QNT = this.DAO_.INSTRUMENT_QNT;
            position.DAO_.EVAL_CURR = this.DAO_.EVAL_CURR;
            position.DAO_.CURR_RATE = this.DAO_.CURR_RATE;
            position.DAO_.NOTIONAL_AMT = this.DAO_.NOTIONAL_AMT;
            position.DAO_.ACCOUNT_AMT = this.DAO_.ACCOUNT_AMT;
            position.DAO_.ACCOUNT_UNIT = this.DAO_.ACCOUNT_UNIT;
            position.DAO_.ACCOUNT_INDEX = this.DAO_.ACCOUNT_INDEX;
            position.DAO_.EVAL_AMT = this.DAO_.EVAL_AMT;
            position.DAO_.EVAL_PRICE = this.DAO_.EVAL_PRICE;
            position.DAO_.EVAL_ACCOUNT_PL = this.DAO_.EVAL_ACCOUNT_PL;

            // 일별 Trade 이므로 날림
            position.DAO_.TRADE_PROFIT = 0.0;
            position.DAO_.TRADE_LOSS = 0.0;
            position.DAO_.TRADE_TOTAL = 0.0;
            position.DAO_.TRANSACTION_FEE = 0.0;
            position.DAO_.ETC_PL = 0.0;

            position.DAO_.TOTAL_ACCOUNT_PL = this.DAO_.TOTAL_ACCOUNT_PL;
            position.DAO_.DAILY_EVAL_PL = this.DAO_.DAILY_EVAL_PL;
            position.DAO_.DAILY_TOTAL_PL = 0.0;
            position.DAO_.BOOK_CD = this.DAO_.BOOK_CD;
        }
Example #4
0
        public override void cumulatePosition(Position tradePosition)
        {
            //throw new NotImplementedException();

            // 이거는 거래 청산용임

            // 장외니까 누적이 안대고 들어오는 순간 쌓이는 거임.
        }
        // position의 안쪽에 있는 instrument 및 손익을 기준일로 평가해서 update함.
        public void evaluate(Position position)
        {
            Financial_instrument f_inst = position.Financial_instrument_;
            // if f_inst == IRS , StockIndexFutures , Option , ELS ? 세부 Type?
            //

            // ?? position을 넘겨야대나..? 기술적인 문제임.
            this.DLL_Interfacer(f_inst);


        }
Example #6
0
 public abstract void cumulatePosition(Position tradePosition);
Example #7
0
 public override void cumulatePosition(Position tradePosition)
 {
     throw new NotImplementedException();
 }