public override bool OnIntervalClose(Interval interval) { switch (interval.BarUnit) { case BarUnit.Minute: if (interval.Period == 1) { closeMinuteBars.Add(NewBar(Minutes)); } if (interval.Period == 30) { closeMinute30Bars.Add(NewBar(Data.Get(Intervals.Minute30))); } break; case BarUnit.Hour: closeHourBars.Add(NewBar(Hours)); break; case BarUnit.Day: closeDayBars.Add(NewBar(Days)); break; case BarUnit.Session: if (Sessions.Count > 0) { closeSessionBars.Add(NewBar(Sessions)); } break; case BarUnit.Week: closeWeekBars.Add(NewBar(Weeks)); break; case BarUnit.Month: closeMonthBars.Add(NewBar(Months)); break; case BarUnit.Year: closeYearBars.Add(NewBar(Years)); break; } return(true); }
public override bool OnIntervalOpen(Interval interval) { switch (interval.BarUnit) { case BarUnit.Minute: if (interval.Period == 1) { openMinuteBars.Add(NewBar(Minutes)); } if (interval.Period == 30) { openMinute30Bars.Add(NewBar(Data.Get(Intervals.Minute30))); } break; case BarUnit.Hour: openHourBars.Add(NewBar(Hours)); break; case BarUnit.Day: openDayBars.Add(NewBar(Days)); break; case BarUnit.Session: openSessionBars.Add(NewBar(Sessions)); break; case BarUnit.Week: openWeekBars.Add(NewBar(Weeks)); break; case BarUnit.Month: openMonthBars.Add(NewBar(Months)); break; case BarUnit.Year: openYearBars.Add(NewBar(Years)); break; } return(true); }