accounting

package
v1.56.2 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2024 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionStats

type DistributionStats struct {
	PriceLevels   []string                    `json:"priceLevels"`
	TotalQuantity fixedpoint.Value            `json:"totalQuantity"`
	Quantities    map[string]fixedpoint.Value `json:"quantities"`
	Stocks        map[string]StockSlice       `json:"stocks"`
}

type Stock

type Stock types.Trade

func (*Stock) Consume

func (stock *Stock) Consume(quantity fixedpoint.Value) fixedpoint.Value

func (*Stock) String

func (stock *Stock) String() string

type StockDistribution

type StockDistribution struct {
	Symbol             string
	TradingFeeCurrency string
	Stocks             StockSlice
	PendingSells       StockSlice
	// contains filtered or unexported fields
}

func (*StockDistribution) AddTrades

func (m *StockDistribution) AddTrades(trades []types.Trade) (checkpoints []int, err error)

func (*StockDistribution) DistributionStats

func (m *StockDistribution) DistributionStats(level int) *DistributionStats

type StockSlice

type StockSlice []Stock

func (StockSlice) Quantity

func (slice StockSlice) Quantity() (total fixedpoint.Value)

func (StockSlice) QuantityBelowPrice

func (slice StockSlice) QuantityBelowPrice(price fixedpoint.Value) (quantity fixedpoint.Value)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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