stmodels

package
v0.0.0-...-48f0708 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Securities

type Securities struct {
	ID       primitive.ObjectID   `bson:"_id" json:"id"`
	Name     string               `bson:"name" json:"name"`
	BuyCost  float32              `bson:"buycost" json:"buycost"`
	SellCost float32              `bson:"sellcost" json:"sellcost"`
	Stocks   []primitive.ObjectID `bson:"stocks" json:"stocks"`
}

Securities ...

type Stock

type Stock struct {
	ID           primitive.ObjectID `bson:"_id" json:"id"`
	EntityName   string             `bson:"entityName" json:"entityName"`
	EntityCode   string             `bson:"entityCode" json:"entityCode"`
	EntityNumber string             `bson:"entityNumber" json:"entityNumber"`
	Sector       string             `bson:"sector" json:"sector"`
	Subsector    string             `bson:"subsector" json:"subsector"`
}

Stock ... salah nama, should've been stock

func (*Stock) CreateStock

func (stock *Stock) CreateStock() error

CreateStock ...

func (*Stock) DeleteStock

func (stock *Stock) DeleteStock() error

DeleteStock ...

func (*Stock) UpdateStock

func (stock *Stock) UpdateStock(update bson.M) error

UpdateStock ...

type StockProfit

type StockProfit struct {
	ID             primitive.ObjectID `bson:"_id" json:"id"`
	BuyDate        time.Time          `bson:"buydate" json:"buydate"`
	Shares         float64            `bson:"shares" json:"shares"`
	BuyPrice       float64            `bson:"buyprice" json:"buyprice"`
	AvePrice       float64            `bson:"aveprice" json:"aveprice"`
	BuyComm        float64            `bson:"buycomm" json:"buycomm"`
	SellPrice      float64            `bson:"sellprice" json:"sellprice"`
	SellComm       float64            `bson:"sellcomm" json:"sellcomm"`
	Profit         float64            `bson:"profit" json:"profit"`
	ROI            float32            `bson:"roi" json:"roi"`
	BreakSellPrice float64            `bson:"breaksellprice" json:"breaksellprice"`
	SellDate       time.Time          `bson:"selldate" json:"selldate"`
	SecuritiesID   primitive.ObjectID `bson:"securities_id" json:"securities_id"`
	StockID        primitive.ObjectID `bson:"stock_id" json:"stock_id"`
	UserID         primitive.ObjectID `bson:"user_id" json:"user_id"`
	// contains filtered or unexported fields
}

StockProfit ...

type Trade

type Trade struct {
	ID           primitive.ObjectID `bson:"_id" json:"id"`
	Date         time.Time          `bson:"date" json:"date"`
	Price        float64            `bson:"price" json:"price"`
	Buy          bool               `bson:"buy" json:"buy"`
	Sell         bool               `bson:"sell" json:"sell"`
	SecuritiesID primitive.ObjectID `bson:"securities_id" json:"securities_id"`
	StockID      primitive.ObjectID `bson:"stock_id" json:"stock_id"`
	UserID       primitive.ObjectID `bson:"user_id" json:"user_id"`
}

Trade ...

func (*Trade) Calculate

func (trade *Trade) Calculate()

Calculate break-even selling price

Jump to

Keyboard shortcuts

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