Compare commits
2 Commits
9e4c2a70e5
...
6b4b0e6de8
Author | SHA1 | Date |
---|---|---|
Jacob Windle | 6b4b0e6de8 | |
Jacob Windle | 1d985d25a4 |
|
@ -126,9 +126,9 @@ func (c *AllyApi) MarketClock() (resp MarketClockResponse) {
|
|||
return
|
||||
}
|
||||
|
||||
func (c *AllyApi) MarketQuotes() {
|
||||
func (c *AllyApi) MarketQuotes(symbols ...string) {
|
||||
v := url.Values{
|
||||
"symbols": []string{"IBM"},
|
||||
"symbols": symbols,
|
||||
}
|
||||
fmt.Printf("%s\n", c.getWithParameters("market/ext/quotes", v))
|
||||
}
|
||||
|
|
2
main.go
2
main.go
|
@ -5,5 +5,5 @@ func main() {
|
|||
var api AllyApi
|
||||
api.Initialize()
|
||||
|
||||
api.MarketQuotes()
|
||||
api.MarketQuotes("FEYE", "IBM")
|
||||
}
|
||||
|
|
31
types.go
31
types.go
|
@ -147,3 +147,34 @@ type MarketClockResponse struct {
|
|||
Message string `xml:"message"`
|
||||
UnixTime time.Time `xml:"unixtime"`
|
||||
}
|
||||
|
||||
type MarketQuotesResponse struct {
|
||||
XMLName xml.Name `xml:"response"`
|
||||
Quotes []Quote `xml:"quotes"'`
|
||||
}
|
||||
|
||||
/**
|
||||
TODO: Finish this page https://www.ally.com/api/invest/documentation/market-ext-quotes-get-post/
|
||||
*/
|
||||
type Quote struct {
|
||||
XMLName xml.Name `xml:"quote"`
|
||||
AverageDailyPrice100 float64 `xml:"adp_100"`
|
||||
AverageDailyPrice200 float64 `xml:"adp_200"`
|
||||
AverageDailyPrice50 float64 `xml:"adp_50"`
|
||||
AverageDailyVolume21 float64 `xml:"adv_21"`
|
||||
AverageDailyVolume30 float64 `xml:"adv_30"`
|
||||
AverageDailyVolume90 float64 `xml:"adv_90"`
|
||||
AskPrice float64 `xml:"ask"`
|
||||
AskTime time.Time `xml:"ask_time"`
|
||||
AskSize int `xml:"asksz"`
|
||||
Basis float64 `xml:"basis"`
|
||||
Beta float64 `xml:"beta"`
|
||||
Bid float64 `xml:"bid"`
|
||||
BidTime time.Time `xml:"bid_time"`
|
||||
BidSize int `xml:"bidsz"`
|
||||
BidTick int `xml:"bidtick"`
|
||||
Change float64 `xml:"chg"`
|
||||
ChangeSign string `xml:"chg_sign"`
|
||||
ChangeText string `xml:"chg_t"`
|
||||
Close float64 `xml:"cl"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue