Documentation ¶
Index ¶
- Constants
- type Backend
- type CEO
- type Candle
- type CandleParams
- type CandleResolution
- type Company
- type Earning
- type Exchange
- type Grading
- type GradingParams
- type News
- type NewsParams
- type NewsSentiment
- type Option
- type OptionChain
- type OptionChainData
- type PriceTarget
- type Quote
- type Recommendation
- type Symbol
- type URLParams
Constants ¶
const ( // CandleStatusOK candle status ok CandleStatusOK = "ok" // CandleStatusNoData candle has no data CandleStatusNoData = "no_data" // CandleDefaultCount default count for returned candles CandleDefaultCount = 200 )
const ( // DateLayoutDate default date layout DateLayoutDate = "2006-01-02" // DateLayoutDateTime default datetime layout DateLayoutDateTime = "2006-01-02 15:04:05" )
const ( // ParamToken the param for tokens ParamToken = "token" // ParamSymbol the param for symbols ParamSymbol = "symbol" // ParamCount the param for count ParamCount = "count" // ParamFrom the param for from ParamFrom = "from" // ParamTo the param for to ParamTo = "to" // ParamResolution the param for resolution ParamResolution = "resolution" // ParamExchange the param for exchange ParamExchange = "exchange" // ParamCategory the param for category ParamCategory = "category" )
const ( // GradingActionUpgrade upgrade stock GradingActionUpgrade = "up" // GradingActionDowngrade downgrade stock GradingActionDowngrade = "down" // GradingActionMaintains maintain stock GradingActionMaintains = "main" // GradingActionInitiate initiate stock GradingActionInitiate = "init" // GradingActionReiterate reiterate stock GradingActionReiterate = "reit" )
const ( // NewsCategoryGeneral the general news category NewsCategoryGeneral = "general" // NewsCategoryForex the forex news category NewsCategoryForex = "forex" // NewsCategoryCrypto the crypto news category NewsCategoryCrypto = "crypto" // NewsCategoryMerger the merger news category NewsCategoryMerger = "merger" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Get(path string, params URLParams, response interface{}) error Call(method string, path string, params URLParams, response interface{}) error }
Backend the interface for the API
type CEO ¶
type CEO struct { Symbol string `json:"symbol"` Name string `json:"name"` CompanyName string `json:"companyName"` Location string `json:"location"` Salary int `json:"salary"` Bonus int `json:"bonus"` StockAwards int `json:"stockAwards"` OptionAwards int `json:"optionAwards"` NonEquityIncentives int `json:"nonEquityIncentives"` PensionAndDeferred int `json:"pensionAndDeferred"` OtherComp int `json:"otherComp"` Total int `json:"total"` Year string `json:"year"` }
CEO is the company CEO
type Candle ¶
type Candle struct { Close []float64 `json:"c"` High []float64 `json:"h"` Low []float64 `json:"l"` Open []float64 `json:"o"` Status string `json:"s"` Times []time.Time `json:"t"` Volume []float64 `json:"v"` }
Candle is candlestick data for stocks
func (*Candle) UnmarshalJSON ¶
UnmarshalJSON decodes json
type CandleParams ¶
CandleParams the params for the candle endpoint
type CandleResolution ¶
type CandleResolution int
CandleResolution the type for candle resolutions
const ( // CandleResolutionSecond resolution 1 second CandleResolutionSecond CandleResolution = iota // CandleResolution5Second resolution 5 seconds CandleResolution5Second // CandleResolution15Second resolution 15 seconds CandleResolution15Second // CandleResolution30Second resolution 30 seconds CandleResolution30Second // CandleResolutionMinute resolution 1 minute CandleResolutionMinute // CandleResolutionDay resolution 1 day CandleResolutionDay // CandleResolutionWeek resolution 1 week CandleResolutionWeek // CandleResolutionMonth resolution 1 month CandleResolutionMonth )
func (CandleResolution) String ¶
func (d CandleResolution) String() string
type Company ¶
type Company struct { Address string `json:"address"` City string `json:"city"` Country string `json:"country"` Currency string `json:"currency"` CUSIP string `json:"cusip"` Description string `json:"description"` Exchange string `json:"exchange"` GICSIndustryGroup string `json:"ggroup"` GICSIndustry string `json:"gind"` GICSSector string `json:"gsector"` GICSSubIndustry string `json:"gsubind"` ISIN string `json:"isin"` NAICS string `json:"naics"` Name string `json:"name"` Phone string `json:"phone"` State string `json:"state"` Ticker string `json:"ticker"` WebURL *url.URL `json:"weburl"` }
Company data structure for companies
func (*Company) UnmarshalJSON ¶
UnmarshalJSON decodes the json data
type Earning ¶
type Earning struct { Actual float64 `json:"actual"` Estimate float64 `json:"estimate"` Period time.Time `json:"period"` Symbol string `json:"symbol"` }
Earning are the earnings for a company
func (*Earning) UnmarshalJSON ¶
UnmarshalJSON decodes the json data
type Grading ¶
type Grading struct { Symbol string `json:"symbol"` Company string `json:"company"` FromGrade string `json:"fromGrade"` ToGrade string `json:"toGrade"` Action string `json:"action"` Time time.Time `json:"gradeTime"` }
Grading the data structure for upgrade/downgrade
func (*Grading) UnmarshalJSON ¶
UnmarshalJSON decodes the json data
type GradingParams ¶
type GradingParams struct {
Symbol string `json:"symbol"`
}
GradingParams the url params for the grading endpoint
type News ¶
type News struct { Category string `json:"category"` DateTime time.Time `json:"dateTime"` Headline string `json:"headline"` ID int `json:"id"` Image *url.URL `json:"image"` Related string `json:"related"` Source string `json:"source"` Summary string `json:"summary"` URL *url.URL `json:"url"` }
News the data structure for news
func (*News) UnmarshalJSON ¶
UnmarshalJSON decodes the json data
type NewsParams ¶
type NewsParams struct {
Category string
}
NewsParams the url params for the news endpoint
type NewsSentiment ¶
type NewsSentiment struct { Buzz struct { ArticlesInLastWeek int `json:"articlesInLastWeek"` Buzz float64 `json:"buzz"` WeeklyAverage float64 `json:"weeklyAverage"` } `json:"buzz"` CompanyNewsScore float64 `json:"companyNewsScore"` SectorAverageBullishPercent float64 `json:"sectorAverageBullishPercent"` SectorAverageNewsScore float64 `json:"sectorAverageNewsScore"` Sentiment struct { BearishPercent float64 `json:"bearishPercent"` BullishPercent float64 `json:"bullishPercent"` } `json:"sentiment"` Symbol string `json:"symbol"` }
NewsSentiment the data structure for companies news sentiment and statistics
type Option ¶
type Option struct { ContractName string `json:"contractName"` ContractSize string `json:"contractSize"` Currency string `json:"currency"` Type string `json:"type"` InTheMoney bool `json:"inTheMoney"` LastTradeDateTime *time.Time `json:"lastTradeDateTime"` ExpirationDate time.Time `json:"expirationDate"` Strike float64 `json:"strike,string"` LastPrice float64 `json:"lastPrice,string"` Bid float64 `json:"bid,string"` Ask float64 `json:"ask,string"` Change float64 `json:"change,string"` ChangePercent float64 `json:"changePercent,string"` Volume int `json:"volume"` OpenInterest int `json:"openInterest"` ImpliedVolatility float64 `json:"impliedVolatility,string"` Delta float64 `json:"delta,string"` Gamma float64 `json:"gamma,string"` Theta float64 `json:"theta,string"` Vega float64 `json:"vega,string"` Rho float64 `json:"rho,string"` Theoretical float64 `json:"theoretical,string"` IntrinsicValue float64 `json:"intrinsicValue,string"` TimeValue float64 `json:"timeValue,string"` UpdatedAt time.Time `json:"updatedAt"` }
Option the data structure for options
func (*Option) UnmarshalJSON ¶
UnmarshalJSON decodes the json data
type OptionChain ¶
type OptionChain struct { Code string `json:"code"` Exchange string `json:"exchange"` Data []OptionChainData `json:"data"` }
OptionChain the data structure for option chains
type OptionChainData ¶
type OptionChainData struct { ExpirationDate time.Time `json:"expirationDate"` Options struct { Call []Option `json:"CALL"` Put []Option `json:"PUT"` } `json:"options"` }
OptionChainData the option chain data structure
func (*OptionChainData) UnmarshalJSON ¶
func (o *OptionChainData) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the json data
type PriceTarget ¶
type PriceTarget struct { LastUpdated time.Time `json:"lastUpdated"` Symbol string `json:"symbol"` TargetHigh float64 `json:"targetHigh"` TargetLow float64 `json:"targetLow"` TargetMean float64 `json:"targetMean"` TargetMedian float64 `json:"targetMedian"` }
PriceTarget the data structure for price targets
func (*PriceTarget) UnmarshalJSON ¶
func (p *PriceTarget) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the json data
type Quote ¶
type Quote struct { Open float64 `json:"o"` High float64 `json:"h"` Low float64 `json:"l"` Current float64 `json:"c"` PreviousClose float64 `json:"pc"` }
Quote the data structure for quotes
type Recommendation ¶
type Recommendation struct { Buy int `json:"buy"` Hold int `json:"hold"` Period time.Time `json:"period"` Sell int `json:"sell"` StrongBuy int `json:"strongBuy"` StrongSell int `json:"strongSell"` Symbol string `json:"symbol"` }
Recommendation the data structure for recommendations
func (*Recommendation) UnmarshalJSON ¶
func (r *Recommendation) UnmarshalJSON(data []byte) error
UnmarshalJSON decodes the json data
Source Files ¶
- candle.go
- candle_params.go
- candle_resolution.go
- ceo.go
- company.go
- date.go
- earning.go
- exchange.go
- finnhub.go
- grading.go
- grading_action.go
- grading_params.go
- news.go
- news_category.go
- news_params.go
- news_sentiment.go
- option.go
- option_chain.go
- option_chain_data.go
- price_target.go
- quote.go
- recommendation.go
- symbol.go