Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AverageCostCalculator ¶
func (*AverageCostCalculator) Calculate ¶
func (c *AverageCostCalculator) Calculate(symbol string, trades []types.Trade, currentPrice fixedpoint.Value) *AverageCostPnlReport
type AverageCostPnlReport ¶
type AverageCostPnlReport struct {
LastPrice fixedpoint.Value `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 fixedpoint.Value `json:"averageCost"`
BuyVolume fixedpoint.Value `json:"buyVolume,omitempty"`
SellVolume fixedpoint.Value `json:"sellVolume,omitempty"`
FeeInUSD fixedpoint.Value `json:"feeInUSD"`
Stock fixedpoint.Value `json:"stock"`
CurrencyFees map[string]fixedpoint.Value `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
Click to show internal directories.
Click to hide internal directories.