analyser

package
v0.0.0-...-c4b29bc Latest Latest
Warning

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

Go to latest
Published: May 14, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelWorst = iota
	LevelBad
	LevelWarning
	LevelNormal
	LevelGood
	LevelExcellent
	LevelBest
)

Metrics levels

Variables

This section is empty.

Functions

func Calculate

func Calculate(code string, date string)

Calculate calculates metrics

func CalculateScore

func CalculateScore(code string) (Score, []Metrics)

CalculateScore calculates currenct financial score for given stock

func CashFlowScore

func CashFlowScore(cashRatio, cashFlowRatio, receivableTurnoverDays float64) int

CashFlowScore calculates cash flow score, full sore is 100

func FinanceScore

func FinanceScore(lev, longTermRatio float64) int

FinanceScore calculates finance score, full sore is 100

func GetGrowingStocks

func GetGrowingStocks(n int, rate float64)

GetGrowingStocks gets growing stocks

func OperationScore

func OperationScore(totalAssetTurnover, inventoryTurnoverDays float64) int

OperationScore calculates operation score, full sore is 100

func ProfitabilityScore

func ProfitabilityScore(roe, grossMargin, netProfitRatio, operatingExpenseRatio float64) int

ProfitabilityScore calculates profitability score, full sore is 100

func SolvencyScore

func SolvencyScore(currentRatio, quickRatio float64) int

SolvencyScore calculates solvency score, full sore is 100

Types

type GrowthData

type GrowthData struct {
	Year         string
	Income       float64
	Cost         float64
	Profit       float64
	OwnersEquity float64
	CurrentAsset float64
	Cash         float64
}

GrowthData is the annual growth data

func CalculateGrowthRate

func CalculateGrowthRate(code string, n int) ([]GrowthData, error)

CalculateGrowthRate calculates growth rate of last n years

type Metrics

type Metrics struct {
	Level   int
	Comment string
	Key     string
	Value   float64
}

Metrics is the financial metrics

func CashFlowRatioMetrics

func CashFlowRatioMetrics(v float64) Metrics

CashFlowRatioMetrics is cash flow ratio metrics

func CashMetrics

func CashMetrics(v float64) Metrics

CashMetrics is cash metrics

func GrossMarginMetrics

func GrossMarginMetrics(v float64) Metrics

GrossMarginMetrics is gross margin metrics

func InventoryTurnoverDaysMetrics

func InventoryTurnoverDaysMetrics(v float64) Metrics

InventoryTurnoverDaysMetrics is inventory turnover days metrics

func LevMetrics

func LevMetrics(v float64) Metrics

LevMetrics is ratio of liabilities to assets metrics

func LongTermRatioMetrics

func LongTermRatioMetrics(v float64) Metrics

LongTermRatioMetrics is long term capital ratio metrics

func NetProfitRatioMetrics

func NetProfitRatioMetrics(v float64) Metrics

NetProfitRatioMetrics is net profit ratio metrics

func OperatingExpenseRatioMetrics

func OperatingExpenseRatioMetrics(v float64) Metrics

OperatingExpenseRatioMetrics is operating expense ratio metrics

https://caibaoshuo.com/terms/00914/scale_charges_ratio

func QuickRatioMetrics

func QuickRatioMetrics(v float64) Metrics

QuickRatioMetrics is quick ratio metrics

func ROEMetrics

func ROEMetrics(v float64) Metrics

ROEMetrics is roe metrics

func ReceivableTurnoverDaysMetrics

func ReceivableTurnoverDaysMetrics(v float64) Metrics

ReceivableTurnoverDaysMetrics is receivable turnover days metrics

func TotalAssetsTurnoverMetrics

func TotalAssetsTurnoverMetrics(v float64) Metrics

TotalAssetsTurnoverMetrics is total assets turnover metrics

func (Metrics) HTML

func (m Metrics) HTML() template.HTML

HTML returns html comment

func (Metrics) Print

func (m Metrics) Print()

Print prints comment

type Score

type Score struct {
	CashFlow      int
	Solvency      int
	Operation     int
	Profitability int
	Finance       int
}

Score is the calculated score of finance statement

ref: https://caibaoshuo.com/helps/cbs_chart

func (Score) Rate

func (s Score) Rate() float32

Rate calculates total ratings

Jump to

Keyboard shortcuts

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