accounting

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 7 Imported by: 1 module, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 float64               `json:"totalQuantity"`
	Quantities    map[string]float64    `json:"quantities"`
	Stocks        map[string]StockSlice `json:"stocks"`
}

type Stock

type Stock types.Trade

func (*Stock) Consume

func (stock *Stock) Consume(quantity float64) float64

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 float64)

func (StockSlice) QuantityBelowPrice

func (slice StockSlice) QuantityBelowPrice(price float64) (quantity float64)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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