pnl

package
v1.26.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 8 Imported by: 3 modules, 4 packages

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 AverageCostCalculator

type AverageCostCalculator struct {
	TradingFeeCurrency string
	Market             types.Market
}

func (*AverageCostCalculator) Calculate

func (c *AverageCostCalculator) Calculate(symbol string, trades []types.Trade, currentPrice float64) *AverageCostPnlReport

type AverageCostPnlReport

type AverageCostPnlReport struct {
	LastPrice float64      `json:"lastPrice"`
	StartTime time.Time    `json:"startTime"`
	Symbol    string       `json:"symbol"`
	Market    types.Market `json:"market"`

	NumTrades        int                `json:"numTrades"`
	Profit           fixedpoint.Value   `json:"profit"`
	NetProfit        fixedpoint.Value   `json:"netProfit"`
	UnrealizedProfit fixedpoint.Value   `json:"unrealizedProfit"`
	AverageCost      float64            `json:"averageCost"`
	BuyVolume        float64            `json:"buyVolume,omitempty"`
	SellVolume       float64            `json:"sellVolume,omitempty"`
	FeeInUSD         float64            `json:"feeInUSD"`
	Stock            float64            `json:"stock"`
	CurrencyFees     map[string]float64 `json:"currencyFees"`
}

func (*AverageCostPnlReport) JSON added in v1.18.5

func (report *AverageCostPnlReport) JSON() ([]byte, error)

func (AverageCostPnlReport) Print

func (report AverageCostPnlReport) Print()

func (AverageCostPnlReport) SlackAttachment

func (report AverageCostPnlReport) SlackAttachment() slack.Attachment

Jump to

Keyboard shortcuts

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