Example #1
0
    public (DateTime start, DateTime endExclusive) LongRangeForDate(DateTime date, TimeFrame timeFrame)
    {
        switch (timeFrame.Name)
        {
        case "m1":
            return(DateRangeUtils.GetMonths(date));

        case "h1":
            return(DateRangeUtils.GetYear(date));

        default:
            throw new NotImplementedException();
        }
    }
Example #2
0
    public (DateTime start, DateTime endExclusive) ShortRangeForDate(DateTime date, TimeFrame timeFrame)
    {
        switch (timeFrame.Name)
        {
        case "m1":
            return(DateRangeUtils.GetDays(date, 1));

        case "h1":
            return(DateRangeUtils.GetMonths(date));

        //return (new DateTime(date.Year, date.Month, 1, 0, 0, 0, DateTimeKind.Utc), new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month), 23, 0, 0, DateTimeKind.Utc));
        default:
            throw new NotImplementedException();
        }
    }