Documentation ¶
Index ¶
- type AccumulatedProfitReport
- func (r *AccumulatedProfitReport) AddStrategyParameter(title string, value string)
- func (r *AccumulatedProfitReport) AddTrade(trade types.Trade)
- func (r *AccumulatedProfitReport) CsvHeader() []string
- func (r *AccumulatedProfitReport) CsvRecords() [][]string
- func (r *AccumulatedProfitReport) Initialize(symbol string, interval types.Interval, window int)
- func (r *AccumulatedProfitReport) Output()
- func (r *AccumulatedProfitReport) Rotate(ps *types.ProfitStats, ts *types.TradeStats)
- type ProfitStatsTracker
- func (p *ProfitStatsTracker) AddProfit(profit types.Profit)
- func (p *ProfitStatsTracker) AddTrade(trade types.Trade)
- func (p *ProfitStatsTracker) Bind(session *bbgo.ExchangeSession, tradeCollector *core.TradeCollector)
- func (p *ProfitStatsTracker) Init(market types.Market, ts *types.TradeStats)
- func (p *ProfitStatsTracker) InitLegacy(market types.Market, ps **types.ProfitStats, ts *types.TradeStats)
- func (p *ProfitStatsTracker) Rotate()
- func (p *ProfitStatsTracker) Subscribe(session *bbgo.ExchangeSession, symbol string)
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 // 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
func (r *AccumulatedProfitReport) Rotate(ps *types.ProfitStats, ts *types.TradeStats)
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)
Click to show internal directories.
Click to hide internal directories.