report

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: AGPL-3.0 Imports: 9 Imported by: ? modules, 0 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 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

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

func (*AccumulatedProfitReport) AddTrade

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

func (*AccumulatedProfitReport) CsvHeader

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

CsvHeader returns a header slice

func (*AccumulatedProfitReport) CsvRecords

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

type ProfitStatsTracker

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

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

func (*ProfitStatsTracker) AddTrade

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

func (*ProfitStatsTracker) Bind

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

func (*ProfitStatsTracker) Init

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

Init initialize the tracker with the given Market

func (*ProfitStatsTracker) InitLegacy

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

func (p *ProfitStatsTracker) Rotate()

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

func (*ProfitStatsTracker) Subscribe

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