yahoofinance

package
v0.0.0-...-952c1c6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2016 License: MIT Imports: 13 Imported by: 0

Documentation

Index

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 Csv

func Csv(baseUrl string, params url.Values) (io.ReadCloser, error)

func GenChartUrl

func GenChartUrl(symbol string, period ChartPeriod, compare []string) string

func NewCsv

func NewCsv() forecast.Source

func NewYql

func NewYql() forecast.Source

func Yql

func Yql(query string) ([]byte, error)

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

func (s *Source) DividendHistLimit(symbols []string, start time.Time, end time.Time) (models.DividendHistMap, error)

func (*Source) Hist

func (s *Source) Hist(symbols []string) (models.HistMap, error)

func (*Source) HistLimit

func (s *Source) HistLimit(symbols []string, start time.Time, end time.Time) (models.HistMap, error)

func (*Source) Quote

func (s *Source) Quote(symbols []string) (models.Quotes, error)

func (*Source) String

func (s *Source) String() string

type Tables

type Tables struct {
	Quotes     string
	QuotesList string
}

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 YqlJsonMeta struct {
	Count   int       `json:"count"`
	Created time.Time `json:"created"`
	Lang    string    `json:"lang"`
}

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"`
	DividendPerShare utils.NullFloat64 `json:"DividendShare"`
	EarningsPerShare utils.NullFloat64 `json:"EarningsShare"`
	DividendYield    utils.NullFloat64 `json:"DividendYield"`
	PeRatio          utils.NullFloat64 `json:"PERatio"`
}

func (*YqlJsonQuote) Process

func (q *YqlJsonQuote) Process()

completes data

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL