예제 #1
0
        // #CreateInstrument_ItemAdd
        public static Financial_instrument CreateInstrument(clsMAST_FP_INSTRUMENT_TB tb)
        {
            int type = tb.FP_MASTER_TYP;

            Financial_instrument fi = new Unknown_fi_instrument();

            if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Kospi200_IndexFutures)
            {
                fi = 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)
            {
                fi = new Kospi200Index_option();
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.VanillaIRS)
            {
                fi = new VanillaIRS_instrument();
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.VanillaSwap)
            {
                fi = new Vanilla_Swap();
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Ftp_DepositLoan)
            {
                fi = new Ftp_DepositLoan();
            }
            else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Money_Cash)
            {
                fi = new CurrencyCash();
            }

            else
            {
                //fi = new Unknown_instrument();
            }

            fi.baseDAO_ = tb;
            fi.loadDetail(tb.INSTRUMENT_ID);

            return fi;
        }
예제 #2
0
        public static Ftp_DepositLoan CreateFixedDepositLoan(long notional,
                                                            DateTime effective,
                                                            string currency,
                                                            bool depositLoanFlag,
                                                            double rate)
        {
            Ftp_DepositLoan inst = new Ftp_DepositLoan();

            // Master
            string inst_ID = IDGenerator.getNewInstrumentID(inst.InstrumentType_, effective, inst);

            inst.baseDAO_.INSTRUMENT_ID = inst_ID;
            inst.baseDAO_.INSTRUMENT_NM = "FTP_DepositLoan";
            inst.baseDAO_.FP_MASTER_TYP = (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Ftp_DepositLoan;
            inst.baseDAO_.NOTIONAL = notional;
            inst.baseDAO_.PRICE = rate;
            inst.baseDAO_.QUANTITY = 1.0;
            inst.baseDAO_.CURR = currency;
            inst.baseDAO_.FX_RATE = 1.0;

            inst.baseDAO_.EFFECTIVE_DT = effective.ToString("yyyyMMdd");
            inst.baseDAO_.MATURITY_DT = "20991231";
            
            inst.baseDAO_.BOOKED_DT = ""; // 아직 booking 전
            inst.baseDAO_.CLOSED_DT = "20991231";

            inst.DAO_.INSTRUMENT_ID = inst_ID;
            inst.DAO_.INSTRUMENT_TYP = inst.baseDAO_.FP_MASTER_TYP;
            inst.DAO_.NOTIONAL = notional;
            inst.DAO_.QUANTITY = 1;
            inst.DAO_.CURR = currency;
            inst.DAO_.DEPOSITELOAN_TYP = (depositLoanFlag) ? 1 : -1;
            inst.DAO_.INDEX_CD = "INTERNAL_FTP";
            inst.DAO_.INDEX_RATE = rate;
            inst.DAO_.SPREAD = 0.0;
            inst.DAO_.EFFECTIVE_DT = effective.ToString("yyyyMMdd");
            inst.DAO_.MATURITY_DT = "20991231";

            return inst;

        }