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 // 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 ¶
func (r *AccumulatedProfitReport) Rotate(ps *types.ProfitStats, ts *types.TradeStats)
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)
Click to show internal directories.
Click to hide internal directories.