market hours tweaks.
This commit is contained in:
parent
c3a066aecd
commit
b1cd8bd2e3
8 changed files with 253 additions and 39 deletions
|
|
@ -22,5 +22,24 @@ func TestSequenceMarketHours(t *testing.T) {
|
|||
|
||||
today := time.Date(2016, 07, 01, 12, 0, 0, 0, Date.Eastern())
|
||||
mh := Sequence.MarketHours(today, today, NYSEOpen, NYSEClose, Date.IsNYSEHoliday)
|
||||
assert.Len(mh, 7)
|
||||
assert.Len(mh, 8)
|
||||
assert.Equal(Date.Eastern(), mh[0].Location())
|
||||
}
|
||||
|
||||
func TestSequenceMarketQuarters(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
today := time.Date(2016, 07, 01, 12, 0, 0, 0, Date.Eastern())
|
||||
mh := Sequence.MarketHourQuarters(today, today, NYSEOpen, NYSEClose, Date.IsNYSEHoliday)
|
||||
assert.Len(mh, 4)
|
||||
assert.Equal(9, mh[0].Hour())
|
||||
assert.Equal(30, mh[0].Minute())
|
||||
assert.Equal(Date.Eastern(), mh[0].Location())
|
||||
|
||||
assert.Equal(12, mh[1].Hour())
|
||||
assert.Equal(00, mh[1].Minute())
|
||||
assert.Equal(Date.Eastern(), mh[1].Location())
|
||||
|
||||
assert.Equal(14, mh[2].Hour())
|
||||
assert.Equal(00, mh[2].Minute())
|
||||
assert.Equal(Date.Eastern(), mh[2].Location())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue