aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorterminaldweller <devi@terminaldweller.com>2024-05-28 20:58:26 +0000
committerterminaldweller <devi@terminaldweller.com>2024-05-28 20:58:26 +0000
commitcb4215af63f149e7dd5a4a8b34589b6cfa6f8f68 (patch)
treea91de35a513cbf1257f7f37be1741fd4fc60dabf
parentadded polygon as a new data source, updated for go 1.22 (diff)
downloadhived-cb4215af63f149e7dd5a4a8b34589b6cfa6f8f68.tar.gz
hived-cb4215af63f149e7dd5a4a8b34589b6cfa6f8f68.zip
polygon ticker type
-rw-r--r--hived/polygonTicerResponseType.go54
1 files changed, 54 insertions, 0 deletions
diff --git a/hived/polygonTicerResponseType.go b/hived/polygonTicerResponseType.go
new file mode 100644
index 0000000..6d8b323
--- /dev/null
+++ b/hived/polygonTicerResponseType.go
@@ -0,0 +1,54 @@
+package main
+
+type PolygonTickerDataLastTrade struct {
+ C []int `json:"c"`
+ I string `json:"i"`
+ P float64 `json:"p"`
+ S int `json:"s"`
+ T int64 `json:"t"`
+ X int `json:"x"`
+}
+
+type PolygonTickerDataDay struct {
+ C float64 `json:"c"`
+ H float64 `json:"h"`
+ L float64 `json:"l"`
+ O float64 `json:"o"`
+ V float64 `json:"v"`
+ VW float64 `json:"vw"`
+}
+
+type PolygonTickerDataPrevDay struct {
+ C float64 `json:"c"`
+ H float64 `json:"h"`
+ L float64 `json:"l"`
+ O float64 `json:"o"`
+ V float64 `json:"v"`
+ VW float64 `json:"vw"`
+}
+
+type PolygonTickerDataMin struct {
+ C float64 `json:"c"`
+ H float64 `json:"h"`
+ L float64 `json:"l"`
+ N float64 `json:"n"`
+ O float64 `json:"o"`
+ T float64 `json:"t"`
+ V float64 `json:"v"`
+ VW float64 `json:"vw"`
+}
+
+type PolygonTickerData struct {
+ Min PolygonTickerDataMin `json:"min"`
+ Day PolygonTickerDataDay `json:"day"`
+ PrevDay PolygonTickerDataPrevDay `json:"prevDay"`
+}
+
+type PolygonTickerResponse struct {
+ RequestID string `json:"request_id"`
+ Status string `json:"status"`
+ TodaysChange float64 `json:"todaysChange"`
+ TodaysChangePerc float64 `json:"todaysChangePerc"`
+ Updated float64 `json:"updated"`
+ Ticker PolygonTickerData `json:"ticker"`
+}