21 using System.Collections.Generic;
32 private int _historyCount;
53 public override IEnumerable<Slice>
GetHistory(IEnumerable<HistoryRequest> requests, DateTimeZone sliceTimeZone)
55 var single = requests.FirstOrDefault();
61 var currentLocalTime = single.StartTimeLocal;
62 while (currentLocalTime < single.EndTimeLocal)
64 if (single.ExchangeHours.IsOpen(currentLocalTime, single.IncludeExtendedMarketHours))
69 if (single.DataType == typeof(
TradeBar))
74 Time = currentLocalTime,
78 Close = _historyCount,
79 Volume = _historyCount,
80 Period = single.Resolution.ToTimeSpan()
83 else if (single.DataType == typeof(
QuoteBar))
88 Time = currentLocalTime,
89 Ask =
new Bar(_historyCount, _historyCount, _historyCount, _historyCount),
90 Bid =
new Bar(_historyCount, _historyCount, _historyCount, _historyCount),
91 Period = single.Resolution.ToTimeSpan()
101 Time = currentLocalTime
104 else if (single.Symbol.SecurityType.IsOption())
109 single.Symbol.ID.Market,
110 single.Symbol.Underlying.SecurityType.DefaultOptionStyle(),
113 currentLocalTime.AddDays(20)),
114 Time = currentLocalTime
130 currentLocalTime = currentLocalTime.Add(single.Resolution.ToTimeSpan());