accounting

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT 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 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