public void db_implement_check(TradeInfo ti) { clsHITM_TRADEINFO_TB clstb = new clsHITM_TRADEINFO_TB(); // #JOB_TRADEINFOCREATE TradeInfo.CreateTradeInfo(clstb); }
public static int getTradeSeq(DateTime tradeDate) { clsHITM_TRADEINFO_TB clstb = new clsHITM_TRADEINFO_TB(); clstb.TRADE_DT = tradeDate.ToString("yyyyMMdd"); List<int> result = new List<int>(); foreach (DataRow dr in clstb.Select().Select()) { result.Add(clsHITM_TRADEINFO_TB.Create(dr).TRADE_SEQ); } //int max = (result.Count == 0) ? 1 : result.Count; int max = result.Count + 1; return max ; }
public void loadTradeInfo() { this.TradeInfoList_.Clear(); clsHITM_TRADEINFO_TB clstb_trading = new clsHITM_TRADEINFO_TB(); clstb_trading.TRADE_DT = this.ReferenceDate_.ToString("yyyyMMdd"); DataTable dt = clstb_trading.Select(); foreach (DataRow dr in dt.Select()) { clsHITM_TRADEINFO_TB clstb_roop = clsHITM_TRADEINFO_TB.Create(dr); TradeInfo ti = TradeInfo.CreateTradeInfo(clstb_roop); this.TradeInfoList_.Add(ti); } }
// #CREATETRADEINFO_ITEMADD public static TradeInfo CreateTradeInfo(clsHITM_TRADEINFO_TB tb) { int type = tb.FP_MASTER_TYP; TradeInfo ti = new UnknownType_TradeInfo(); if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Kospi200_IndexFutures) { ti = new Kospi200FuturesTradeInfo(); } 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) { ti = new Kospi200OptionTradeInfo(); } else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.VanillaIRS) { ti = new VanillaIRSTradeInfo(); } else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.VanillaSwap) { ti = new Vanilla_SwapTradeInfo(); } else if (type == (int)clsMAST_FP_INSTRUMENT_TB.FP_MASTER_TYP_Type.Ftp_DepositLoan) { ti = new Ftp_DepositLoanTradeInfo(); } else { //fi = new Unknown_instrument(); } ti.DAO_ = tb; //fi.baseDAO_ = tb; //fi.loadDetail(tb.INSTRUMENT_ID); return ti; }
public clsHITM_TRADEINFO_TB Clone() { try { clsHITM_TRADEINFO_TB cloneTB = new clsHITM_TRADEINFO_TB(); cloneTB._TRADE_ID = this._TRADE_ID; cloneTB._INSTRUMENT_ID = this._INSTRUMENT_ID; cloneTB._TRADE_DT = this._TRADE_DT; cloneTB._TRADE_TM = this._TRADE_TM; cloneTB._TRADE_SEQ = this._TRADE_SEQ; cloneTB._TRADE_TYP = this._TRADE_TYP; cloneTB._FP_MASTER_TYP = this._FP_MASTER_TYP; cloneTB._TRADE_UNIT = this._TRADE_UNIT; cloneTB._TRADE_MULTIPLIER = this._TRADE_MULTIPLIER; cloneTB._TRADE_CURR = this._TRADE_CURR; cloneTB._CURR_RATE = this._CURR_RATE; cloneTB._TRADE_INDEX = this._TRADE_INDEX; cloneTB._TRADE_INDEXUNIT = this._TRADE_INDEXUNIT; cloneTB._BUY_SELL = this._BUY_SELL; cloneTB._TRADE_QNT = this._TRADE_QNT; cloneTB._TRADE_NOTIONAL_AMT = this._TRADE_NOTIONAL_AMT; cloneTB._ACCOUNT_AMT = this._ACCOUNT_AMT; cloneTB._TRADE_FEE = this._TRADE_FEE; cloneTB._TRADE_FEE_PAYMENT_DT = this._TRADE_FEE_PAYMENT_DT; cloneTB._TRADE_PL = this._TRADE_PL; cloneTB._COUNTER_ID = this._COUNTER_ID; cloneTB._BOOK_CD = this._BOOK_CD; cloneTB._BOOKED_FLAG = this._BOOKED_FLAG; return cloneTB; } catch(Exception ex) { throw new Exception(ex.Message); } }
public static clsHITM_TRADEINFO_TB Create(DataRow dr) { try { clsHITM_TRADEINFO_TB tb = new clsHITM_TRADEINFO_TB(); tb._TRADE_ID = Convert.ToString(dr[0]); tb._INSTRUMENT_ID = Convert.ToString(dr[1]); tb._TRADE_DT = Convert.ToString(dr[2]); tb._TRADE_TM = Convert.ToString(dr[3]); tb._TRADE_SEQ = Convert.ToInt32(dr[4]); tb._TRADE_TYP = Convert.ToInt32(dr[5]); tb._FP_MASTER_TYP = Convert.ToInt32(dr[6]); tb._TRADE_UNIT = Convert.ToDouble(dr[7]); tb._TRADE_MULTIPLIER = Convert.ToDouble(dr[8]); tb._TRADE_CURR = Convert.ToString(dr[9]); tb._CURR_RATE = Convert.ToDouble(dr[10]); tb._TRADE_INDEX = Convert.ToDouble(dr[11]); tb._TRADE_INDEXUNIT = Convert.ToDouble(dr[12]); tb._BUY_SELL = Convert.ToInt32(dr[13]); tb._TRADE_QNT = Convert.ToDouble(dr[14]); tb._TRADE_NOTIONAL_AMT = Convert.ToDouble(dr[15]); tb._ACCOUNT_AMT = Convert.ToDouble(dr[16]); tb._TRADE_FEE = Convert.ToDouble(dr[17]); tb._TRADE_FEE_PAYMENT_DT = Convert.ToString(dr[18]); tb._TRADE_PL = Convert.ToDouble(dr[19]); tb._COUNTER_ID = Convert.ToString(dr[20]); tb._BOOK_CD = Convert.ToString(dr[21]); tb._BOOKED_FLAG = Convert.ToInt32(dr[22]); return tb; } catch(Exception ex) { throw new Exception(ex.Message); } }
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(); } }