gobist

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: MIT Imports: 4 Imported by: 0

README

gobist - GO library for BIST (Borsa Istanbul)

This project aims to provide some useful tools to fetch stock data for BIST via Yahoo Finance API

Installation

$ go get github.com/guneyin/gobist

Example

func main() {
    bist := gobist.New()
    
    tBegin, _ := time.Parse(time.DateOnly, "2023-09-25")
    tEnd, _ := time.Parse(time.DateOnly, "2024-10-25")
    
    q, err := bist.GetQuoteWithHistory([]string{"TUPRS", "BIMAS", "VESBE", "THYAO"}, tBegin, tEnd)
    if err != nil {
        log.Fatal(err)
    }
    
    fmt.Println(fmt.Sprintf("%-10s %-30s %-20s %-20s %-20s %-15s %-30s", "Symbol", "Name", "Current Price", "History Begin", "History End", "Change", "Error"))
    for _, item := range q.Items {
        fmt.Println(fmt.Sprintf("%-10s %-30s %-20f %-20f %-20f %-15f %-30s",
        item.Symbol, item.Name, item.Price, item.History.Begin.Price, item.History.End.Price, item.History.Change.ByRatio, item.Error))
    }
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bist

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

func New

func New() *Bist

func (*Bist) GetCompany added in v1.0.6

func (b *Bist) GetCompany(ctx context.Context, code string) (*kap.Company, error)

func (*Bist) GetCompanyWithShares added in v1.0.6

func (b *Bist) GetCompanyWithShares(ctx context.Context, code string) (*kap.Company, error)

func (*Bist) GetQuote

func (b *Bist) GetQuote(ctx context.Context, symbols string, opts ...quote.OptionFunc) (*quote.Quote, error)

func (*Bist) GetQuoteList added in v1.0.4

func (b *Bist) GetQuoteList(ctx context.Context, symbols []string, opts ...quote.OptionFunc) (*quote.List, error)

func (*Bist) GetSymbolList

func (b *Bist) GetSymbolList(ctx context.Context) (*quote.SymbolList, error)

func (*Bist) WithStore

func (b *Bist) WithStore(store store.Store) *Bist

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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