report

package
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: AGPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccumulatedProfitReport

type AccumulatedProfitReport struct {
	// ProfitMAWindow Accumulated profit SMA window
	ProfitMAWindow int `json:"profitMAWindow"`

	// ShortTermProfitWindow The window to sum up the short-term profit
	ShortTermProfitWindow int `json:"shortTermProfitWindow"`

	// TsvReportPath The path to output report to
	TsvReportPath string `json:"tsvReportPath"`

	types.IntervalWindow

	// ProfitMAWindow Accumulated profit SMA window
	AccumulateTradeWindow int `json:"accumulateTradeWindow"`

	// Profit of each interval
	ProfitPerInterval floats.Slice
	// contains filtered or unexported fields
}

AccumulatedProfitReport For accumulated profit report output

func (*AccumulatedProfitReport) AddStrategyParameter added in v1.51.0

func (r *AccumulatedProfitReport) AddStrategyParameter(title string, value string)

func (*AccumulatedProfitReport) AddTrade added in v1.51.0

func (r *AccumulatedProfitReport) AddTrade(trade types.Trade)

func (*AccumulatedProfitReport) CsvHeader added in v1.51.0

func (r *AccumulatedProfitReport) CsvHeader() []string

CsvHeader returns a header slice

func (*AccumulatedProfitReport) CsvRecords added in v1.51.0

func (r *AccumulatedProfitReport) CsvRecords() [][]string

CsvRecords returns a data slice

func (*AccumulatedProfitReport) Initialize

func (r *AccumulatedProfitReport) Initialize(symbol string, interval types.Interval, window int)

func (*AccumulatedProfitReport) Output

func (r *AccumulatedProfitReport) Output()

Output Accumulated profit report to a TSV file

func (*AccumulatedProfitReport) Rotate added in v1.51.0

type ProfitStatsTracker added in v1.51.0

type ProfitStatsTracker struct {
	types.IntervalWindow

	// Accumulated profit report
	AccumulatedProfitReport *AccumulatedProfitReport `json:"accumulatedProfitReport"`

	Market types.Market

	ProfitStatsSlice   []*types.ProfitStats
	CurrentProfitStats **types.ProfitStats
	// contains filtered or unexported fields
}

func (*ProfitStatsTracker) AddProfit added in v1.51.0

func (p *ProfitStatsTracker) AddProfit(profit types.Profit)

func (*ProfitStatsTracker) AddTrade added in v1.51.0

func (p *ProfitStatsTracker) AddTrade(trade types.Trade)

func (*ProfitStatsTracker) Bind added in v1.51.0

func (p *ProfitStatsTracker) Bind(session *bbgo.ExchangeSession, tradeCollector *core.TradeCollector)

func (*ProfitStatsTracker) Init added in v1.51.0

func (p *ProfitStatsTracker) Init(market types.Market, ts *types.TradeStats)

Init initialize the tracker with the given Market

func (*ProfitStatsTracker) InitLegacy added in v1.51.0

func (p *ProfitStatsTracker) InitLegacy(market types.Market, ps **types.ProfitStats, ts *types.TradeStats)

InitLegacy is for backward capability. ps is the ProfitStats of the strategy, Market is the strategy Market

func (*ProfitStatsTracker) Rotate added in v1.51.0

func (p *ProfitStatsTracker) Rotate()

Rotate the tracker to make a new ProfitStats to record the profits

func (*ProfitStatsTracker) Subscribe added in v1.51.0

func (p *ProfitStatsTracker) Subscribe(session *bbgo.ExchangeSession, symbol string)

Jump to

Keyboard shortcuts

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