Compare commits

...

2 Commits

3 changed files with 34 additions and 3 deletions

View File

@ -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))
}

View File

@ -5,5 +5,5 @@ func main() {
var api AllyApi
api.Initialize()
api.MarketQuotes()
api.MarketQuotes("FEYE", "IBM")
}

View File

@ -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"`
}