/// <summary>
 /// Reads all ticks from the IBarsReader with TimeStamp property less than
 /// "until".
 /// </summary>
 public static IEnumerable <IBar> ReadUntilJustBefore(this IBarsReader reader, TimeStamp until)
 {
     while (reader.GetTimestampNextBarOrMaxValue() < until)
     {
         yield return(reader.ReadNext());
     }
 }
 /// <summary>
 /// Reads all available bars from the <paramref name="reader"/>.
 /// </summary>
 public static IEnumerable <IBar> ReadRemaining(this IBarsReader reader)
 {
     while (reader.ReadNext() is IBar bar)
     {
         yield return(bar);
     }
 }