public static Tick[] ToTick2(Bar bar) { List <Tick> list = new List <Tick>(); DateTime dt = Util.ToDateTime(bar.Date, bar.BarStartTime).AddSeconds(bar.Interval); // close at bartime+interval list.Add(Tick.NewTrade(bar.FullSymbol, Util.ToIntDate(dt), Util.ToIntTime(dt), bar.Close, (int)bar.Volume)); return(list.ToArray()); }
public static Tick[] ToTick(Bar bar) { List <Tick> list = new List <Tick>(); list.Add(Tick.NewTrade(bar.FullSymbol, bar.Date, bar.BarStartTime, bar.Open, (int)((double)bar.Volume / 4))); list.Add(Tick.NewTrade(bar.FullSymbol, bar.Date, bar.BarStartTime, bar.High, (int)((double)bar.Volume / 4))); list.Add(Tick.NewTrade(bar.FullSymbol, bar.Date, bar.BarStartTime, bar.Low, (int)((double)bar.Volume / 4))); list.Add(Tick.NewTrade(bar.FullSymbol, bar.Date, bar.BarStartTime, bar.Close, (int)((double)bar.Volume / 4))); return(list.ToArray()); }