Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
Aligned the "Minute" members of intraday and historical data points.
Browse files Browse the repository at this point in the history
They appear to both be used the same way, as a string field that tells
us the minute of the data point in the time zone of the exchange.
  • Loading branch information
karagog committed Feb 17, 2022
1 parent a14c0b5 commit ad436ff
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 2 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ func TestHistoricalPrices(t *testing.T) {
"key": "AAPL",
"subkey": "12345",
"date": "2021-12-03",
"minute": "9:30",
"uOpen": 164.02,
"uClose": 161.84,
"uHigh": 164.96,
Expand All @@ -521,6 +522,7 @@ func TestHistoricalPrices(t *testing.T) {
Key: "AAPL",
Subkey: "12345",
Date: Date(time.Date(2021, 12, 3, 0, 0, 0, 0, time.UTC)),
Minute: HourMinute(9*time.Hour + 30*time.Minute),
UOpen: 164.02,
UClose: 161.84,
UHigh: 164.96,
Expand Down
40 changes: 20 additions & 20 deletions historical.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,26 @@ type IntradayHistoricalOptions struct {

// HistoricalDataPoint Represents a single historical data point for a stock
type HistoricalDataPoint struct {
Close float64 `json:"close"`
High float64 `json:"high"`
Low float64 `json:"low"`
Open float64 `json:"open"`
Symbol string `json:"symbol"`
Volume float64 `json:"volume"`
ID string `json:"id"`
Key string `json:"key"`
Subkey string `json:"subkey"`
Date Date `json:"date"`
Minute string `json:"minute"`
UOpen float64 `json:"uOpen"`
UClose float64 `json:"uClose"`
UHigh float64 `json:"uHigh"`
ULow float64 `json:"uLow"`
UVolume int `json:"uVolume"`
Change float64 `json:"change"`
ChangePercent float64 `json:"changePercent"`
Label string `json:"label"`
ChangeOverTime float64 `json:"changeOverTime"`
Close float64 `json:"close"`
High float64 `json:"high"`
Low float64 `json:"low"`
Open float64 `json:"open"`
Symbol string `json:"symbol"`
Volume int `json:"volume"`
ID string `json:"id"`
Key string `json:"key"`
Subkey string `json:"subkey"`
Date Date `json:"date"`
Minute HourMinute `json:"minute"`
UOpen float64 `json:"uOpen"`
UClose float64 `json:"uClose"`
UHigh float64 `json:"uHigh"`
ULow float64 `json:"uLow"`
UVolume int `json:"uVolume"`
Change float64 `json:"change"`
ChangePercent float64 `json:"changePercent"`
Label string `json:"label"`
ChangeOverTime float64 `json:"changeOverTime"`
}

// Time merges HistoricalDataPoint's Date and Mintue field and
Expand Down

0 comments on commit ad436ff

Please sign in to comment.