??
This commit is contained in:
parent
8fbb8d9775
commit
b22d565d44
2 changed files with 10 additions and 3 deletions
|
|
@ -78,9 +78,8 @@ func (mhr *MarketHoursRange) GetTicks(vf ValueFormatter) []Tick {
|
|||
// figure out how to advance one ticke per market day.
|
||||
var ticks []Tick
|
||||
|
||||
cursor := date.On(mhr.MarketOpen, mhr.Min)
|
||||
cursor := date.On(mhr.MarketClose, mhr.Min)
|
||||
maxClose := date.On(mhr.MarketClose, mhr.Max)
|
||||
|
||||
for date.BeforeDate(cursor, maxClose) {
|
||||
if date.IsWeekDay(cursor.Weekday()) && !mhr.GetHolidayProvider()(cursor) {
|
||||
ticks = append(ticks, Tick{
|
||||
|
|
@ -92,6 +91,13 @@ func (mhr *MarketHoursRange) GetTicks(vf ValueFormatter) []Tick {
|
|||
cursor = cursor.AddDate(0, 0, 1)
|
||||
}
|
||||
|
||||
endMarketClose := date.On(mhr.MarketClose, cursor)
|
||||
if date.IsWeekDay(endMarketClose.Weekday()) && !mhr.GetHolidayProvider()(endMarketClose) {
|
||||
ticks = append(ticks, Tick{
|
||||
Value: TimeToFloat64(endMarketClose),
|
||||
Label: vf(endMarketClose),
|
||||
})
|
||||
}
|
||||
return ticks
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue