reader

package
v0.0.0-...-1c4fd92 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const BOCBaseUrl string = "http://www.bankofcanada.ca/valet/observations/%s/csv"
View Source
const FredBaseUrl string = "https://fred.stlouisfed.org/graph/fredgraph.csv?id=%s"
View Source
const StooqBaseUrl string = "https://stooq.com/q/d/l"
View Source
const TIINGO_API_KEY = "TIINGO_API_KEY"
View Source
const TiingoBaseUrl string = "https://api.tiingo.com/tiingo/daily/%s/prices"

Variables

View Source
var DefaultHeaders = map[string]string{
	"Connection":                "keep-alive",
	"Expires":                   "-1",
	"Upgrade-Insecure-Requests": "1",
	"User-Agent":                "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
}

Functions

func GetData

func GetData(reader DataReader) dataframe.DataFrame

Types

type BOCDataReader

type BOCDataReader struct {
	// contains filtered or unexported fields
}

func NewBOCDataReader

func NewBOCDataReader(config BOCReaderConfig) (*BOCDataReader, error)

type BOCReaderConfig

type BOCReaderConfig struct {
	Symbols   []string
	StartDate time.Time
	EndDate   time.Time
}

type DataReader

type DataReader interface {
	// contains filtered or unexported methods
}

type FredDataReader

type FredDataReader struct {
	// contains filtered or unexported fields
}

func NewFredDataReader

func NewFredDataReader(config FredReaderConfig) (*FredDataReader, error)

type FredReaderConfig

type FredReaderConfig struct {
	Symbols   []string
	StartDate time.Time
	EndDate   time.Time
}

type MockReader

type MockReader struct {
	// contains filtered or unexported fields
}

type StooqDataReader

type StooqDataReader struct {
	// contains filtered or unexported fields
}

func NewStooqDataReader

func NewStooqDataReader(config StooqReaderConfig) (*StooqDataReader, error)

type StooqReaderConfig

type StooqReaderConfig struct {
	Symbols   []string
	StartDate time.Time
	EndDate   time.Time
	Freq      string
}

type TiingoDailyReader

type TiingoDailyReader struct {
	// contains filtered or unexported fields
}

func NewTiingoDailyReader

func NewTiingoDailyReader(config TiingoReaderConfig) (*TiingoDailyReader, error)

type TiingoReaderConfig

type TiingoReaderConfig struct {
	Symbols   []string
	StartDate time.Time
	EndDate   time.Time
	ApiKey    string
}

type TiingoRecord

type TiingoRecord struct {
	Date        string  `json:"Date"`
	Close       float32 `json:"Close"`
	High        float32 `json:"High"`
	Low         float32 `json:"Low"`
	Open        float32 `json:"Open"`
	Volume      float32 `json:"Volume"`
	AdjClose    float32 `json:"AdjClose"`
	AdjHigh     float32 `json:"AdjHigh"`
	AdjLow      float32 `json:"AdjLow"`
	AdjOpen     float32 `json:"AdjOpen"`
	AdjVolume   float32 `json:"AdjVolume"`
	DivCash     float32 `json:"DivCash"`
	SplitFactor float32 `json:"SplitFactor"`
}

Jump to

Keyboard shortcuts

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