render

package
v0.0.0-...-6c4cad4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SortName     util.SortBy = "name"
	SortDyield   util.SortBy = "dyield"
	SortDividend util.SortBy = "dividend"
	SortExdate   util.SortBy = "exdate"

	ExDateMonth util.GroupBy = "exdate"
)
View Source
const (
	WalletStock    util.SortBy = "stock"
	WalletInvested util.SortBy = "invested"
)

Variables

This section is empty.

Functions

func NewScreenListStocks

func NewScreenListStocks(precision int) *screenListStocks

func NewScreenWalletDetails

func NewScreenWalletDetails() *screenWalletDetails

func NewScreenWalletStockDetails

func NewScreenWalletStockDetails(ctx context.Context) *screenStockWalletDetails

func NewWalletDateDetails

func NewWalletDateDetails(ctx context.Context) *screenWalletDateDetails

Types

type OutputScreenListStocks

type OutputScreenListStocks struct {
	Stocks []*StockOutput

	GroupBy util.GroupBy
	Sorting util.Sorting
}

type OutputScreenWalletDetails

type OutputScreenWalletDetails struct {
	WalletDetails WalletDetailsOutput

	GroupBy util.GroupBy
	Sorting util.Sorting

	Precision int
}

type OutputScreenWalletStockDetails

type OutputScreenWalletStockDetails struct {
	OutputScreenWalletDetails

	Stock string
}

type Render

type Render interface {
	Render(output interface{})
}

type StockOutput

type StockOutput struct {
	ID                  uuid.UUID
	Stock               string
	Market              string
	Symbol              string
	Value               mm.Value
	High52Week          mm.Value
	Low52Week           mm.Value
	BuyUnder            mm.Value
	Dividend            mm.Value
	DividendRetention   mm.Value
	PercentageRetention float64
	DYield              float64
	DividendStatus      dividend.Status
	EPS                 float64
	ExDate              time.Time
	Change              mm.Value
	UpdatedAt           time.Time
	HV52Week            float64
	HV20Day             float64
	PER                 float64

	PriceWithHighLow int
}

type Stocks

type Stocks []*StockOutput

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// START Stocks Sort /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

func (Stocks) Len

func (s Stocks) Len() int

func (Stocks) Swap

func (s Stocks) Swap(i, j int)

type TradeOutput

type TradeOutput struct {
	ID     uuid.UUID
	Number int
	Stock  string
	Market string
	Symbol string

	Enter struct {
		Amount float64
		Kurs   mm.Value
		Total  mm.Value
	}

	Position struct {
		Amount   float64
		Dividend mm.Value
		Capital  mm.Value
	}

	Exit struct {
		Amount float64
		Kurs   mm.Value
		Total  mm.Value
	}

	Net               mm.Value
	BenefitPercentage float64

	IsProfitable bool
}

type WalletDetailsOutput

type WalletDetailsOutput struct {
	WalletOutput       WalletOutput
	WalletStockOutputs []*WalletStockOutput
}

type WalletDividendProjected

type WalletDividendProjected struct {
	Month     string
	Projected mm.Value
	Yield     float64
}

type WalletItems

type WalletItems []*WalletStockOutput

func (WalletItems) Len

func (s WalletItems) Len() int

func (WalletItems) Swap

func (s WalletItems) Swap(i, j int)

type WalletItemsByInvested

type WalletItemsByInvested struct {
	WalletItems
}

WalletItemsByInvested implements sort.Interface by providing Less and using the Len and Swap methods of the embedded ExportWalletItems value.

func (WalletItemsByInvested) Less

func (s WalletItemsByInvested) Less(i, j int) bool

type WalletItemsByName

type WalletItemsByName struct {
	WalletItems
}

WalletItemsByName implements sort.Interface by providing Less and using the Len and Swap methods of the embedded ExportWalletItems value.

func (WalletItemsByName) Less

func (s WalletItemsByName) Less(i, j int) bool

type WalletOutput

type WalletOutput struct {
	Capital               mm.Value
	Invested              mm.Value
	Funds                 mm.Value
	FreeMargin            mm.Value
	NetCapital            mm.Value
	NetBenefits           mm.Value
	PercentageBenefits    float64
	DividendPayed         mm.Value
	DividendPayedYield    float64
	DividendYearProjected mm.Value
	DividendYearYield     float64
	Connection            mm.Value
	Interest              mm.Value
	Commission            mm.Value

	DividendProjected []WalletDividendProjected
}

type WalletStockOutput

type WalletStockOutput struct {
	StockOutput
	Amount             int
	Capital            mm.Value
	Invested           mm.Value
	DividendPayed      mm.Value
	DividendToPay      mm.Value
	PercentageWallet   float64
	Buys               mm.Value
	Sells              mm.Value
	NetBenefits        mm.Value
	PercentageBenefits float64
	Change             mm.Value
	WAPrice            mm.Value
	WADYield           float64
	Trades             []*TradeOutput
}

Jump to

Keyboard shortcuts

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