stock

package
v0.0.0-...-74856e8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCompanyList

func GetCompanyList() ([]int, error)

GetCompanyList looks up all the companies' code on HKEX

func HketTest

func HketTest() error

func InsertIndustry

func InsertIndustry(data []Industry) error

InsertIndustry inserts to the industry table

func InsertPerformance

func InsertPerformance(data []Performance) error

InsertPerformance inserts to the industry_performance table

func InsertSector

func InsertSector(data []Sector) error

InsertSector inserts to the sector table

func Yahoo

func Yahoo()

Types

type Company

type Company struct {
	Code string
	Name string
}

type Foo

type Foo struct {
	Bar string
}

type Industry

type Industry struct {
	Date      string
	Sector    string
	Industry  string
	CodeF     string
	Close     float64
	Change    float64
	ChangePct float64
	Volume    int
	Turnover  int
	PE        float64 // Price per Earnings
	PB        float64 // Price to Book
	YieldPct  float64
	MarketCap int
}

Industry Overview from aastock

func GetIndustryOverview

func GetIndustryOverview(date string) ([]Industry, error)

Gets all the sectors + industry code

type Performance

type Performance struct {
	Date     string
	Sector   string
	Industry string
	Code     string
	Close    float64
	ThreeY   float64 // 3-years
	OneY     float64 // 1-year
	SixM     float64 // 6-months
	ThreeM   float64 // 3-months
	OneM     float64 // 1-months
	OneW     float64 // 1-week
	Ytd      float64 // year to date
}

Performance from aastock

func GetIndustryPerformance

func GetIndustryPerformance(date string) ([]Performance, error)

Gets all the sectors + industry code

type Sector

type Sector struct {
	Date        string
	Sector      string
	ChangePct   float64
	PchangePct  float64
	Turnover    int
	AvgTurnover int
	AvgPE       float64
	ZoneA       int // > +2%
	ZoneB       int // 0 - +2%
	ZoneC       int // 0%
	ZoneD       int // 0 - -2%
	ZoneE       int // < -2%
	ZoneN       int // total no of stocks
}

Sector for industry sector overview

func GetSectorOveriew

func GetSectorOveriew(date string) ([]Sector, error)

Jump to

Keyboard shortcuts

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