internal HistoricalData(ResponseReader r) // a one-shot deal { if (!r.Builder.SupportsServerVersion(ServerVersion.SYNT_REALTIME_BARS)) { r.RequireVersion(3); } RequestId = r.ReadInt(); Start = r.ReadLocalDateTime(DateTimePattern); End = r.ReadLocalDateTime(DateTimePattern); int n = r.ReadInt(); for (int i = 0; i < n; i++) { Bars.Add(new HistoricalDataBar(r)); } }
internal HistoricalDataBar(ResponseReader r) { Date = r.ReadLocalDateTime(HistoricalData.DateTimePattern); Open = r.ReadDouble(); High = r.ReadDouble(); Low = r.ReadDouble(); Close = r.ReadDouble(); Volume = r.ReadLong(); WeightedAveragePrice = r.ReadDouble(); if (!r.Builder.SupportsServerVersion(ServerVersion.SYNT_REALTIME_BARS)) { r.ReadString(); /*string hasGaps = */ } Count = r.ReadInt(); }