Documentation ¶
Overview ¶
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2024 SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( ZACKS_HOMEPAGE_URL string = `https://zacks.com` ZACKS_LOGIN_URL string = `https://www.zacks.com/logout.php` ZACKS_STOCK_SCREENER_URL string = `https://www.zacks.com/screening/stock-screener` )
Variables ¶
var ( ErrProviderNotFound = errors.New("provider not found") ErrDatasetNotFound = errors.New("dataset not found") )
var (
ErrInvalidStatusCode = errors.New("invalid status code received")
)
Functions ¶
func NewSubscription ¶
func NewSubscription(providerName, datasetName string, config map[string]string, myLibrary *library.Library) (*library.Subscription, error)
NewSubscription returns a new subscription object with the dataset properly filled out
Types ¶
type Dataset ¶
type Dataset struct { Name string Description string DataTypes []*data.DataType DateRange func() (time.Time, time.Time) // Fetch is called when pvdata wants to retrieve measurements from the dataset. It // passes a config with the provider configuration, a channel to write results to, // a logger to write log messages to, and a channel to write progress. Fetch func(context.Context, *library.Subscription, chan<- *data.Observation, chan<- data.RunSummary) }
type Fred ¶
type Fred struct{}
Example query for a specific economic indicator on all trading dayings: select trading_days, locf(value) OVER( ORDER BY trading_days ) from trading_days(date'2024-04-01', date'2024-06-30') left join fred_economic_indicator_0b97b f ON (f.series='UNRATE' AND trading_days = f.event_date) order by trading_days desc;
func (*Fred) ConfigDescription ¶
func (*Fred) Description ¶
type Polygon ¶
type Polygon struct { }
func (*Polygon) ConfigDescription ¶
func (*Polygon) Description ¶
type Sharadar ¶
type Sharadar struct{}
func (*Sharadar) ConfigDescription ¶
func (*Sharadar) Description ¶
type Tiingo ¶
type Tiingo struct { }
func (*Tiingo) ConfigDescription ¶
func (*Tiingo) Description ¶
type ZacksRecord ¶
type ZacksRecord struct { CompanyName string `` /* 130-byte string literal not displayed */ Ticker string `` /* 134-byte string literal not displayed */ CompositeFigi string `` /* 153-byte string literal not displayed */ Exchange string `csv:"Exchange" json:"exchange" parquet:"name=exchange, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` EventDateStr string `csv:"-" json:"event_date" parquet:"name=event_date, type=BYTE_ARRAY, convertedtype=UTF8, encoding=PLAIN_DICTIONARY"` EventDate time.Time `csv:"-" json:"-"` InSp500 bool `csv:"S&P 500 - ETF" json:"in_sp500" parquet:"name=in_sp500, type=BOOLEAN" db:"in_sp500"` LastClose float64 `csv:"Last Close" json:"last_close" parquet:"name=last_close, type=DOUBLE"` MonthOfFiscalYrEnd int `` /* 146-byte string literal not displayed */ Optionable bool `csv:"Optionable" json:"optionable" parquet:"name=optionable, type=BOOLEAN" db:"optionable"` Sector string `` /* 134-byte string literal not displayed */ Industry string `` /* 142-byte string literal not displayed */ MarketCapMil float64 `csv:"Market Cap (mil)" json:"market_cap_mil" parquet:"name=market_cap_mil, type=DOUBLE" db:"market_cap_mil,omitempty"` AvgVolume int64 `csv:"Avg Volume" json:"avg_volume" parquet:"name=avg_volume, type=INT64" db:"avg_volume,omitempty"` WkHigh52 float64 `csv:"52 Week High" json:"wk_high_52" parquet:"name=wk_high_52, type=DOUBLE" db:"wk_high_52,omitempty"` WkLow52 float64 `csv:"52 Week Low" json:"wk_low_52" parquet:"name=wk_low_52, type=DOUBLE" db:"wk_low_52,omitempty"` PriceAsPercentOf52wkHighLow float32 `` /* 170-byte string literal not displayed */ Beta float32 `csv:"Beta" json:"beta" parquet:"name=beta, type=FLOAT" db:"beta,omitempty"` PercentPriceChange1Wk float32 `` /* 153-byte string literal not displayed */ PercentPriceChange4Wk float32 `` /* 154-byte string literal not displayed */ PercentPriceChange12Wk float32 `` /* 158-byte string literal not displayed */ PercentPriceChangeYtd float32 `` /* 150-byte string literal not displayed */ RelativePriceChange float32 `` /* 142-byte string literal not displayed */ ZacksRank int `csv:"Zacks Rank" json:"zacks_rank" parquet:"name=zacks_rank, type=INT32" db:"zacks_rank,omitempty"` ZacksRankChangeIndicator int `` /* 166-byte string literal not displayed */ ZacksIndustryRank int `` /* 134-byte string literal not displayed */ ValueScore string `` /* 154-byte string literal not displayed */ GrowthScore string `` /* 158-byte string literal not displayed */ MomentumScore string `` /* 166-byte string literal not displayed */ VgmScore string `` /* 146-byte string literal not displayed */ CurrentAvgBrokerRec float32 `` /* 146-byte string literal not displayed */ NumBrokersInRating int `` /* 143-byte string literal not displayed */ NumRatingStrongBuyOrBuy int `` /* 168-byte string literal not displayed */ PercentRatingStrongBuyOrBuy float32 `` /* 180-byte string literal not displayed */ NumRatingHold int `csv:"# Rating Hold" json:"num_rating_hold" parquet:"name=num_rating_hold, type=INT32" db:"num_rating_hold,omitempty"` NumRatingStrongSellOrSell int `` /* 176-byte string literal not displayed */ PercentRatingStrongSellOrSell float32 `` /* 188-byte string literal not displayed */ PercentRatingChange4Wk float32 `` /* 158-byte string literal not displayed */ IndustryRankOfAbr int `` /* 140-byte string literal not displayed */ RankInIndustryOfAbr int `` /* 152-byte string literal not displayed */ ChangeInAvgRec float32 `` /* 127-byte string literal not displayed */ NumberRatingUpgrades int `` /* 141-byte string literal not displayed */ NumberRatingDowngrades int `` /* 150-byte string literal not displayed */ PercentRatingHold float32 `` /* 128-byte string literal not displayed */ PercentRatingUpgrades float32 `` /* 145-byte string literal not displayed */ PercentRatingDowngrades float32 `` /* 153-byte string literal not displayed */ AverageTargetPrice float64 `` /* 139-byte string literal not displayed */ EarningsEsp float32 `csv:"Earnings ESP" json:"earnings_esp" parquet:"name=earnings_esp, type=FLOAT" db:"earnings_esp,omitempty"` LastEpsSurprisePercent float32 `` /* 154-byte string literal not displayed */ PreviousEpsSurprisePercent float32 `` /* 170-byte string literal not displayed */ AvgEpsSurpriseLast4Qtrs float32 `` /* 172-byte string literal not displayed */ LastQtrEps float32 `csv:"Last Qtr EPS" json:"last_qtr_eps" parquet:"name=last_qtr_eps, type=FLOAT" db:"last_qtr_eps,omitempty"` LastReportedQtrDateStr string `` /* 164-byte string literal not displayed */ LastReportedQtrDate time.Time `csv:"-" json:"-" db:"last_reported_qtr_date,omitempty"` LastYrEpsF0BeforeNri float32 `` /* 162-byte string literal not displayed */ TwelveMoTrailingEps float32 `` /* 142-byte string literal not displayed */ LastReportedFiscalYrStr string `` /* 173-byte string literal not displayed */ LastReportedFiscalYr time.Time `csv:"-" json:"-" db:"last_reported_fiscal_yr,omitempty"` LastEpsReportDateStr string `` /* 165-byte string literal not displayed */ LastEpsReportDate time.Time `csv:"-" json:"-" db:"last_eps_report_date,omitempty"` NextEpsReportDateStr string `` /* 166-byte string literal not displayed */ NextEpsReportDate time.Time `csv:"-" json:"-" db:"next_eps_report_date,omitempty"` PercentChangeQ0Est float32 `` /* 147-byte string literal not displayed */ PercentChangeQ2Est float32 `` /* 147-byte string literal not displayed */ PercentChangeF1Est float32 `` /* 147-byte string literal not displayed */ PercentChangeQ1Est float32 `` /* 147-byte string literal not displayed */ PercentChangeF2Est float32 `` /* 147-byte string literal not displayed */ PercentChangeLtGrowthEst float32 `` /* 175-byte string literal not displayed */ Q0ConsensusEstLastCompletedFiscalQtr float32 `` /* 229-byte string literal not displayed */ NumberOfAnalystsInQ0Consensus int `` /* 189-byte string literal not displayed */ Q1ConsensusEst float32 `csv:"Q1 Consensus Est. " json:"q1_consensus_est" parquet:"name=q1_consensus_est, type=FLOAT" db:"q1_consensus_est,omitempty"` NumberOfAnalystsInQ1Consensus int `` /* 189-byte string literal not displayed */ StdevQ1Q1ConsensusRatio float32 `` /* 165-byte string literal not displayed */ Q2ConsensusEstNextFiscalQtr float32 `` /* 189-byte string literal not displayed */ NumberOfAnalystsInQ2Consensus int `` /* 189-byte string literal not displayed */ StdevQ2Q2ConsensusRatio float32 `` /* 165-byte string literal not displayed */ F0ConsensusEst float32 `csv:"F0 Consensus Est." json:"f0_consensus_est" parquet:"name=f0_consensus_est, type=FLOAT" db:"f0_consensus_est,omitempty"` NumberOfAnalystsInF0Consensus float32 `` /* 189-byte string literal not displayed */ F1ConsensusEst float32 `csv:"F1 Consensus Est." json:"f1_consensus_est" parquet:"name=f1_consensus_est, type=FLOAT" db:"f1_consensus_est,omitempty"` NumberOfAnalystsInF1Consensus int `` /* 189-byte string literal not displayed */ StdevF1F1ConsensusRatio float32 `` /* 165-byte string literal not displayed */ F2ConsensusEst float32 `csv:"F2 Consensus Est." json:"f2_consensus_est" parquet:"name=f2_consensus_est, type=FLOAT" db:"f2_consensus_est,omitempty"` NumberOfAnalystsInF2Consensus int `` /* 189-byte string literal not displayed */ FiveYrHistEpsGrowth float32 `` /* 149-byte string literal not displayed */ LongTermGrowthConsensusEst float32 `` /* 179-byte string literal not displayed */ PercentChangeEps float32 `` /* 138-byte string literal not displayed */ LastYrsGrowth float32 `` /* 134-byte string literal not displayed */ ThisYrsEstGrowth float32 `` /* 149-byte string literal not displayed */ PercentRatioOfQ1Q0 float32 `` /* 140-byte string literal not displayed */ PercentRatioOfQ1PriorYrQ1ActualQ float32 `` /* 216-byte string literal not displayed */ SalesGrowth float32 `csv:"Sales Growth F(0)/F(-1)" json:"sales_growth" parquet:"name=sales_growth, type=FLOAT" db:"sales_growth,omitempty"` FiveYrHistoricalSalesGrowth float32 `` /* 179-byte string literal not displayed */ Q1ConsensusSalesEstMil float32 `` /* 168-byte string literal not displayed */ F1ConsensusSalesEstMil float32 `` /* 168-byte string literal not displayed */ PeTrailing12Months float32 `` /* 145-byte string literal not displayed */ PeF1 float32 `csv:"P/E (F1)" json:"pe_f1" parquet:"name=pe_f1, type=FLOAT" db:"pe_f1,omitempty"` PeF2 float32 `csv:"P/E (F2)" json:"pe_f2" parquet:"name=pe_f2, type=FLOAT" db:"pe_f2,omitempty"` PegRatio float32 `csv:"PEG Ratio" json:"peg_ratio" parquet:"name=peg_ratio, type=FLOAT" db:"peg_ratio,omitempty"` PriceToCashFlow float32 `` /* 127-byte string literal not displayed */ PriceToSales float32 `csv:"Price/Sales" json:"price_to_sales" parquet:"name=price_to_sales, type=FLOAT" db:"price_to_sales,omitempty"` PriceToBook float32 `csv:"Price/Book" json:"price_to_book" parquet:"name=price_to_book, type=FLOAT" db:"price_to_book,omitempty"` CurrentRoeTtm float32 `csv:"Current ROE (TTM)" json:"current_roe_ttm" parquet:"name=current_roe_ttm, type=FLOAT" db:"current_roe_ttm,omitempty"` CurrentRoiTtm float32 `csv:"Current ROI (TTM)" json:"current_roi_ttm" parquet:"name=current_roi_ttm, type=FLOAT" db:"current_roi_ttm,omitempty"` Roi5YrAvg float32 `csv:"ROI (5 Yr Avg)" json:"roi_5_yr_avg" parquet:"name=roi_5_yr_avg, type=FLOAT" db:"roi_5_yr_avg,omitempty"` CurrentRoaTtm float32 `csv:"Current ROA (TTM)" json:"current_roa_ttm" parquet:"name=current_roa_ttm, type=FLOAT" db:"current_roa_ttm,omitempty"` Roa5YrAvg float32 `csv:"ROA (5 Yr Avg)" json:"roa_5_yr_avg" parquet:"name=roa_5_yr_avg, type=FLOAT" db:"roa_5_yr_avg,omitempty"` MarketValueToNumberAnalysts float32 `` /* 174-byte string literal not displayed */ AnnualSalesMil float32 `csv:"Annual Sales ($mil)" json:"annual_sales_mil" parquet:"name=annual_sales_mil, type=FLOAT" db:"annual_sales_mil,omitempty"` CostOfGoodsSoldMil float32 `` /* 149-byte string literal not displayed */ EbitdaMil float32 `csv:"EBITDA ($mil)" json:"ebitda_mil" parquet:"name=ebitda_mil, type=FLOAT" db:"ebitda_mil,omitempty"` EbitMil float32 `csv:"EBIT ($mil)" json:"ebit_mil" parquet:"name=ebit_mil, type=FLOAT" db:"ebit_mil,omitempty"` PretaxIncomeMil float32 `` /* 129-byte string literal not displayed */ NetIncomeMil float32 `csv:"Net Income ($mil)" json:"net_income_mil" parquet:"name=net_income_mil, type=FLOAT" db:"net_income_mil,omitempty"` CashFlowMil float32 `csv:"Cash Flow ($mil)" json:"cash_flow_mil" parquet:"name=cash_flow_mil, type=FLOAT" db:"cash_flow_mil,omitempty"` NetIncomeGrowthF0FNeg1 float32 `` /* 167-byte string literal not displayed */ TwelveMoNetIncomeCurrentToLastPercent float32 `` /* 222-byte string literal not displayed */ TwelveMoNetIncomeCurrent1qToLast1qPercent float32 `` /* 246-byte string literal not displayed */ DivYieldPercent float32 `csv:"Div. Yield %" json:"div_yield_percent" parquet:"name=div_yield_percent, type=FLOAT" db:"div_yield_percent,omitempty"` FiveYrDivYieldPercent float32 `` /* 150-byte string literal not displayed */ FiveYrHistDivGrowthPercent float32 `` /* 175-byte string literal not displayed */ Dividend float32 `csv:"Dividend " json:"dividend" parquet:"name=dividend, type=FLOAT" db:"dividend,omitempty"` NetMarginPercent float32 `csv:"Net Margin %" json:"net_margin_percent" parquet:"name=net_margin_percent, type=FLOAT" db:"net_margin_percent,omitempty"` Turnover float32 `csv:"Turnover" json:"turnover" parquet:"name=turnover, type=FLOAT" db:"turnover,omitempty"` OperatingMargin12MoPercent float32 `` /* 172-byte string literal not displayed */ InventoryTurnover float32 `` /* 130-byte string literal not displayed */ AssetUtilization float32 `` /* 126-byte string literal not displayed */ ReceivablesMil float32 `csv:"Receivables ($mil)" json:"receivables_mil" parquet:"name=receivables_mil, type=FLOAT" db:"receivables_mil,omitempty"` IntangiblesMil float32 `csv:"Intangibles ($mil)" json:"intangibles_mil" parquet:"name=intangibles_mil, type=FLOAT" db:"intangibles_mil,omitempty"` InventoryMil float32 `csv:"Inventory ($mil)" json:"inventory_mil" parquet:"name=inventory_mil, type=FLOAT" db:"inventory_mil,omitempty"` CurrentAssetsMil float32 `` /* 134-byte string literal not displayed */ CurrentLiabilitiesMil float32 `` /* 153-byte string literal not displayed */ LongTermDebtMil float32 `` /* 133-byte string literal not displayed */ PreferredEquityMil float32 `` /* 141-byte string literal not displayed */ CommonEquityMil float32 `` /* 129-byte string literal not displayed */ BookValue float32 `csv:"Book Value" json:"book_value" parquet:"name=book_value, type=FLOAT" db:"book_value,omitempty"` DebtToTotalCapital float32 `` /* 139-byte string literal not displayed */ DebtToEquityRatio float32 `` /* 135-byte string literal not displayed */ CurrentRatio float32 `csv:"Current Ratio" json:"current_ratio" parquet:"name=current_ratio, type=FLOAT" db:"current_ratio,omitempty"` QuickRatio float32 `csv:"Quick Ratio" json:"quick_ratio" parquet:"name=quick_ratio, type=FLOAT" db:"quick_ratio,omitempty"` CashRatio float32 `csv:"Cash Ratio" json:"cash_ratio" parquet:"name=cash_ratio, type=FLOAT" db:"cash_ratio,omitempty"` }