private void nameParsing(string koscomPositionName) { string trim = koscomPositionName.Trim(); string optionType = trim.Substring(13, 1); if (optionType.ToUpper() == "C") { this.callPutEnum_ = QLNet.Option.Type.Call; } else if (optionType.ToUpper() == "P") { this.callPutEnum_ = QLNet.Option.Type.Put; } else { throw new Exception("type doesn't valid , input : " + optionType); } string strikeValue = trim.Substring(14, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; //------------------------- string yearStr = trim.Substring(8, 2); string monthStr = trim.Substring(10, 2); int year = Convert.ToInt32(yearStr) + 2000; int month = Convert.ToInt32(monthStr); this.secondThursday(year, month); }
private void nameParsing(string koscomPositionName) { string trim = koscomPositionName.Trim(); string optionType = trim.Substring(0, 1); string strikeValue = ""; if (optionType.ToUpper() == "C") { this.callPutEnum_ = QLNet.Option.Type.Call; strikeValue = trim.Substring(7, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; } else if (optionType.ToUpper() == "P") { this.callPutEnum_ = QLNet.Option.Type.Put; strikeValue = trim.Substring(7, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; } else if (optionType.ToUpper() == "F") { this.strike_ = 0.0; } //------------------------- string yearStr = trim.Substring(2, 2); string monthStr = trim.Substring(4, 2); int year = Convert.ToInt32(yearStr) + 2000; int month = Convert.ToInt32(monthStr); this.name_ = optionType + " " + yearStr + monthStr + " " + strikeValue; this.secondThursday(year, month); }
private void nameParsing(string koscomPositionName) { string trim = koscomPositionName.Trim(); string optionType = trim.Substring(13, 1); if (optionType.ToUpper() == "C") { this.callPutEnum_ = QLNet.Option.Type.Call; } else if (optionType.ToUpper() == "P") { this.callPutEnum_ = QLNet.Option.Type.Put; } else { throw new Exception("type doesn't valid , input : " + optionType); } string strikeValue = trim.Substring(14, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; //------------------------- string yearStr = trim.Substring(8, 2); string monthStr = trim.Substring(10, 2); int year = Convert.ToInt32(yearStr) + 2000; int month = Convert.ToInt32(monthStr); this.secondThursday(year,month); }
private void nameParsing(string koscomPositionName) { string trim = koscomPositionName.Trim(); string optionType = trim.Substring(0, 1); string strikeValue = ""; if (optionType.ToUpper() == "C") { this.callPutEnum_ = QLNet.Option.Type.Call; strikeValue = trim.Substring(7, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; } else if (optionType.ToUpper() == "P") { this.callPutEnum_ = QLNet.Option.Type.Put; strikeValue = trim.Substring(7, 5); this.strike_ = Convert.ToDouble(strikeValue); this.name_ = optionType + " " + strikeValue; } else if (optionType.ToUpper() == "F") { this.strike_ = 0.0; } //------------------------- string yearStr = trim.Substring(2, 2); string monthStr = trim.Substring(4, 2); int year = Convert.ToInt32(yearStr) + 2000; int month = Convert.ToInt32(monthStr); this.name_ = optionType + " " + yearStr + monthStr + " " + strikeValue; this.secondThursday(year, month); }