public ELSUnderlyingStock( //DateTime referenceDate, string name, long currentPrice, double basePrice, double dividend, string associateDerivativesCode, double volatiltity, Delta delta, Gamma gamma, Vega vega) { //this.referenceDate_ = referenceDate; this.Name_ = name; this.CurrentPrice_ = currentPrice; // - Live //int Quantity_ //double UnitPrice_ - Calculate this.BasePrice_ = basePrice; this.Dividend_ = dividend; this.AssociateDerivativesCode_ = associateDerivativesCode; this.Volatility_ = volatiltity; this.Delta_ = delta; this.Gamma_ = gamma; this.Vega_ = vega; }
public List<ELSUnderlyingStock> ELSUnderlyingStockListLoad() { DataSet dataSet_ = new DataSet(); DataTable dt = dataSet_.Tables["ELSUNDERLYINGSTOCK"]; List<ELSUnderlyingStock> underList = new List<ELSUnderlyingStock>(); foreach (DataRow item in dt.Rows) { string name = item["STOCKNAME"].ToString(); long currentPrice = Convert.ToInt64(item["CURRENTPRICE"].ToString()); long basePrice = Convert.ToInt64(item["BASEPRICE"].ToString()); double dividend = Convert.ToDouble(item["DIVIDEND"].ToString()); string assDerivativesCode = Convert.ToString(item["ASSDERIVATIVESCODE"].ToString()); double vol = Convert.ToDouble(item["VOL"].ToString()); Delta delta = new Delta(Convert.ToDouble(item["DELTA"].ToString())); Gamma gamma = new Gamma(Convert.ToDouble(item["GAMMA"].ToString())); Vega vega = new Vega(Convert.ToDouble(item["VEGA"].ToString())); underList.Add(new ELSUnderlyingStock(name, currentPrice, basePrice, dividend, assDerivativesCode, vol, delta, gamma, vega)); } return underList; }