public Bar(Bar b) { h = b.High; l = b.Low; o = b.Open; c = b.Close; DAYEND = b.DAYEND; bartime = b.bartime; bardate = b.bardate; }
public void Construction() { Bar b = new Bar(); Assert.That(!b.isValid); Assert.That(!b.isNew); b.newTick(ticklist[0]); Assert.That(b.isValid); Assert.That(b.isNew); b.newTick(ticklist[1]); Assert.That(b.isValid); Assert.That(!b.isNew); Assert.That(b.Volume == 200); b.newTick(Tick.NewQuote(sym,d,t,0,10m,11m,1,1,x,x)); Assert.That(b.TradeCount == 2); }
public void BarIntervals() { Bar b = new Bar(BarInterval.FiveMin); int accepts = 0; foreach (Tick k in ticklist) if (b.newTick(k)) accepts++; Assert.That(accepts == 5); b = new Bar(BarInterval.FifteenMin); accepts = 0; foreach (Tick k in ticklist) if (b.newTick(k)) accepts++; Assert.That(accepts == 9); b = new Bar(BarInterval.Minute); accepts = 0; for (int i = 7; i<ticklist.Length; i++) if (b.newTick(ticklist[i])) accepts++; Assert.That(accepts == 2); }
public static int[] Date(Bar bar) { return Date(bar.Bardate); }