/// <summary> /// Laedt Wertpapierdaten aus einer Datei /// </summary> /// <param name="strPathAndName">Dateiname der zu lesenden Datei</param> public void Load(string strPathAndName) { Clear(); EasyStoreReader easystore = new EasyStoreReader(); easystore.Open(strPathAndName); string strSection; while ((strSection = easystore.GetNextSection()) != null) { if (strSection.Equals("META")) { LoadMetaData(easystore); } if (strSection.Equals("QUOTES") || strSection.Equals("CLOSE")) { LoadQuotes(easystore, m_QuotesClose); } if (strSection.Equals("LOW")) { LoadQuotes(easystore, m_QuotesLow); } } easystore.Close(); m_strFilename = (string)strPathAndName.Clone(); }
/// <summary> /// Laedt Meta-Daten aus der Datei /// </summary> private void LoadMetaData(EasyStoreReader easystore) { DateTime termDate = new DateTime(); string strKey, strValue; while (easystore.GetNextKeyValue(out strKey, out strValue)) { if (strKey.Equals("NAME")) { this.Name = strValue; } if (strKey.Equals("SHORTNAME")) { this.ShortName = strValue; } if (strKey.Equals("ISIN")) { this.ISIN = strValue; } if (strKey.Equals("WKN")) { this.WKN = strValue; } if (strKey.Equals("SYMBOL")) { this.Symbol = strValue; } if (strKey.Equals("BONUSLEVEL")) { this.m_dBonusLevel = Double.Parse(strValue); } if (strKey.Equals("CAP")) { this.m_dCap = Double.Parse(strValue); } if (strKey.Equals("KNOCKOUT")) { this.m_dKnockOut = Double.Parse(strValue); } if (strKey.Equals("EXPIRE")) { DateTime.TryParse(strValue, out termDate); this.m_ExpireDate.Set(termDate.Year, termDate.Month, termDate.Day); } if (strKey.Equals("RATIO")) { this.m_dRatio = Double.Parse(strValue); } } }
/// <summary> /// Laedt Kursdaten aus der Datei /// </summary> private void LoadQuotes(EasyStoreReader easystore, DataContainer quotes) { DateTime priceDate = new DateTime(); string strKey, strValue; while (easystore.GetNextKeyValue(out strKey, out strValue)) { DateTime.TryParse(strKey, out priceDate); WorkDate workdate = new WorkDate(priceDate.Year, priceDate.Month, priceDate.Day); quotes[workdate] = Double.Parse(strValue); } }