forked from goinvest/iexcloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
iexdata.go
61 lines (54 loc) · 2.04 KB
/
iexdata.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Copyright (c) 2019 The iexcloud developers. All rights reserved.
// Project site: https://github.com/goinvest/iexcloud
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE file for the project.
package iex
// Last provides trade data for executions on IEX. It is a near real time,
// intraday API that provides IEX last sale price, size and time. Last is ideal
// for developers that need a lightweight stock quote.
type Last struct {
Symbol string `json:"symbol"`
Price float64 `json:"Price"`
Size int `json:"Size"`
Time EpochTime `json:"time"`
}
// Records models the stats records.
type Records struct {
Volume VolumeRecord `json:"volume"`
}
// TOPS contains IEX's aggregated best quoted bid and offer position in near
// real time for all securities on IEX's displayed limit order book.
type TOPS struct {
Symbol string `json:"symbol"`
MarketPercent float64 `json:"marketPercent"`
BidSize int `json:"bidSize"`
BidPrice float64 `json:"bidPrice"`
AskSize int `json:"AskSize"`
AskPrice float64 `json:"AskPrice"`
Volume int `json:"volume"`
LastSalePrice float64 `json:"lastSalePrice"`
LastSaleTime EpochTime `json:"lastSaleTime"`
LastUpdated EpochTime `json:"lastUpdated"`
Sector string `json:"sector"`
SecurityType string `json:"securityType"`
}
// VolumeRecord models the record volume.
type VolumeRecord struct {
Value float64 `json:"recordValue"`
Date Date `json:"recordDate"`
PreviousDayValue float64 `json:"previousDayValue"`
Avg30Value float64 `json:"avg30Value"`
}
// IntradayStats models the intraday stats on IEX.
type IntradayStats struct {
Volume Stat `json:"volume"`
SymbolsTraded Stat `json:"symbolsTraded"`
RoutedVolume Stat `json:"routedVolume"`
Notional Stat `json:"notional"`
MarketShare Stat `json:"marketShare"`
}
// Stat models a single stat.
type Stat struct {
Value float64 `json:"value"`
LastUpdated EpochTime `json:"lastUpdated"`
}