From 40ff878b79397f1fe57f54b4a078b1597a07ad0e Mon Sep 17 00:00:00 2001 From: Will Charczuk Date: Wed, 27 Jul 2016 00:40:22 -0700 Subject: [PATCH] things. --- market_hours_range.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/market_hours_range.go b/market_hours_range.go index 86a7317..f1777e6 100644 --- a/market_hours_range.go +++ b/market_hours_range.go @@ -76,12 +76,18 @@ func (mhr MarketHoursRange) GetHolidayProvider() date.HolidayProvider { // GetTicks returns the ticks for the range. // This is to override the default continous ticks that would be generated for the range. func (mhr *MarketHoursRange) GetTicks(vf ValueFormatter) []Tick { - // return one tick per day - // figure out how to advance one ticke per market day. var ticks []Tick cursor := date.On(mhr.MarketClose, mhr.Min) maxClose := date.On(mhr.MarketClose, mhr.Max) + + if mhr.Min.Before(cursor) { + ticks = append(ticks, Tick{ + Value: TimeToFloat64(cursor), + Label: vf(cursor), + }) + } + for date.BeforeDate(cursor, maxClose) { if date.IsWeekDay(cursor.Weekday()) && !mhr.GetHolidayProvider()(cursor) { ticks = append(ticks, Tick{