Beispiel #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;
        }
Beispiel #2
0
        public static CurrencyCash CurrencyCashBooking(string currency, string book_cd, DateTime bookOpenDate)
        {
            clsMAST_FP_INSTRUMENT_TB clstb = new clsMAST_FP_INSTRUMENT_TB();

            CurrencyCash fi = new CurrencyCash(currency);

            clstb.INSTRUMENT_ID = IDGenerator.getNewInstrumentID(Financial_instrument.InstrumentType.Money_Cash,
                                                                bookOpenDate, fi);

            clstb.INSTRUMENT_NM = currency.ToUpper() + " Cash";
            clstb.FP_MASTER_TYP = (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Money_Cash;
            clstb.NOTIONAL = 0; // 5만달러
            clstb.PRICE = 0; // 1102원
            clstb.QUANTITY = 0; // 1계약 뭐 이런식 2개면 12만달러임. krw로 바꾸는건 view에서
            clstb.CURR = currency;
            clstb.FX_RATE = 1.0;
            clstb.EFFECTIVE_DT = bookOpenDate.ToString("yyyyMMdd");
            clstb.MATURITY_DT = "20991231";
            clstb.BOOK_CD = book_cd;
            clstb.BOOKED_DT = bookOpenDate.ToString("yyyyMMdd");
            clstb.CLOSED_DT = "20991231";

            fi.baseDAO_ = clstb;

            clstb.Insert();

            return fi;

        }