private static void FillBar(int period, string pair, t_Bar bar, Rate t) { bar.Pair = pair; bar.Period = period; bar.StartDate = t.StartDate; bar.AskHigh = (float)t.AskHigh; bar.AskLow = (float)t.AskLow; bar.AskOpen = (float)t.AskOpen; bar.AskClose = (float)t.AskClose; bar.BidHigh = (float)t.BidHigh; bar.BidLow = (float)t.BidLow; bar.BidOpen = (float)t.BidOpen; bar.BidClose = (float)t.BidClose; }
private static t_Bar FillBar(int period, string pair, t_Bar bar, Rate t) { bar.Pair = pair; bar.Period = period; bar.StartDate = t.StartDate2; bar.AskHigh = (float)t.AskHigh; bar.AskLow = (float)t.AskLow; bar.AskOpen = (float)t.AskOpen; bar.AskClose = (float)t.AskClose; bar.BidHigh = (float)t.BidHigh; bar.BidLow = (float)t.BidLow; bar.BidOpen = (float)t.BidOpen; bar.BidClose = (float)t.BidClose; bar.Volume = t.Volume; bar.Row = new[] { t }.OfType <Tick>().Select(tick => tick.Row).DefaultIfEmpty().Single(); return(bar); }