Documentation ¶
Index ¶
- Constants
- Variables
- func Csv(baseUrl string, params url.Values) (io.ReadCloser, error)
- func GenChartUrl(symbol string, period ChartPeriod, compare []string) string
- func NewCsv() forecast.Source
- func NewYql() forecast.Source
- func Yql(query string) ([]byte, error)
- type ChartPeriod
- type Source
- func (s *Source) DividendHist(symbols []string) (models.DividendHistMap, error)
- func (s *Source) DividendHistLimit(symbols []string, start time.Time, end time.Time) (models.DividendHistMap, error)
- func (s *Source) Hist(symbols []string) (models.HistMap, error)
- func (s *Source) HistLimit(symbols []string, start time.Time, end time.Time) (models.HistMap, error)
- func (s *Source) Quote(symbols []string) (models.Quotes, error)
- func (s *Source) String() string
- type Tables
- type YqlJsonHistResponse
- type YqlJsonMeta
- type YqlJsonPureHistResponse
- type YqlJsonQuote
- type YqlJsonQuoteResponse
- type YqlJsonSingleQuoteResponse
Constants ¶
View Source
const ( Day1 ChartPeriod = "1d" Day5 = "5d" Month3 = "3m" Month6 = "6m" Year1 = "1y" Year2 = "2y" Year5 = "5y" MaxPeriod = "my" )
View Source
const ( TypeCsv = iota TypeYql )
View Source
const ( PublicApiUrl = "http://query.yahooapis.com/v1/public/yql" DatatablesUrl = "store://datatables.org/alltableswithkeys" )
View Source
const (
ChartUrl = "http://chart.finance.yahoo.com/z?"
)
chart parameters described at: * https://code.google.com/p/yahoo-finance-managed/wiki/miscapiImageDownload * e.g.: http://chart.finance.yahoo.com/z?s=VUSA.AS&t=6m&q=l&l=on&z=l&p=m50,m200&c=VFEM.AS,XMEM.MI
View Source
const (
HistoricalUrl = "http://ichart.finance.yahoo.com/table.csv"
)
View Source
const (
QuotesUrl = "http://download.finance.yahoo.com/d/quotes.csv"
)
Variables ¶
View Source
var (
YahooTables = Tables{
Quotes: "yahoo.finance.quotes",
QuotesList: "yahoo.finance.quoteslist",
}
)
Functions ¶
func GenChartUrl ¶
func GenChartUrl(symbol string, period ChartPeriod, compare []string) string
Types ¶
type ChartPeriod ¶
type ChartPeriod string
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
func (*Source) DividendHist ¶
func (s *Source) DividendHist(symbols []string) (models.DividendHistMap, error)
func (*Source) DividendHistLimit ¶
type YqlJsonHistResponse ¶
type YqlJsonHistResponse struct { Query struct { YqlJsonMeta Results struct { Rows []models.HistEntry `json:"quote"` } } }
func (*YqlJsonHistResponse) Entries ¶
func (r *YqlJsonHistResponse) Entries() []models.HistEntry
type YqlJsonMeta ¶
type YqlJsonPureHistResponse ¶
type YqlJsonPureHistResponse struct { Query struct { YqlJsonMeta Results struct { Rows []models.HistEntry `json:"row"` } } }
func (*YqlJsonPureHistResponse) Entries ¶
func (r *YqlJsonPureHistResponse) Entries() []models.HistEntry
type YqlJsonQuote ¶
type YqlJsonQuote struct { Name string `json:"Name"` Symbol string `json:"Symbol"` Volume utils.NullInt64 `json:"Volume"` AverageDailyVolume utils.NullInt64 `json:"AverageDailyVolume"` Bid utils.NullFloat64 `json:"Bid"` Ask utils.NullFloat64 `json:"Ask"` Open utils.NullFloat64 `json:"Open"` PreviousClose utils.NullFloat64 `json:"PreviousClose"` LastTradePrice utils.NullFloat64 `json:"LastTradePriceOnly"` Ma50 utils.NullFloat64 `json:"FiftydayMovingAverage"` Ma200 utils.NullFloat64 `json:"TwoHundreddayMovingAverage"` DayLow float64 `json:"-"` DayHigh float64 `json:"-"` YearLow float64 `json:"-"` YearHigh float64 `json:"-"` DaysRangeRaw string `json:"DaysRange"` YearRangeRaw string `json:"YearRange"` ExDividendDate *utils.MonthDay `json:"ExDividendDate"` DividendYield utils.NullFloat64 `json:"DividendYield"` PeRatio utils.NullFloat64 `json:"PERatio"` }
type YqlJsonQuoteResponse ¶
type YqlJsonQuoteResponse struct { Query struct { YqlJsonMeta Results struct { Quote []YqlJsonQuote `json:"quote"` } } }
type YqlJsonSingleQuoteResponse ¶
type YqlJsonSingleQuoteResponse struct { Query struct { YqlJsonMeta Results struct { Quote YqlJsonQuote `json:"quote"` } } }
Click to show internal directories.
Click to hide internal directories.