Documentation ¶
Index ¶
- Constants
- func DrawCumPNL(instanceID string, cumProfit types.Series) *types.Canvas
- func DrawPNL(instanceID string, profit types.Series) *types.Canvas
- type AccumulatedProfitReport
- func (r *AccumulatedProfitReport) DailyUpdate(tradeStats *types.TradeStats)
- func (r *AccumulatedProfitReport) Initialize()
- func (r *AccumulatedProfitReport) Output(symbol string)
- func (r *AccumulatedProfitReport) RecordProfit(profit fixedpoint.Value)
- func (r *AccumulatedProfitReport) RecordTrade(fee fixedpoint.Value)
- type NRR
- func (inc *NRR) BindK(target indicator.KLineClosedEmitter, symbol string, interval types.Interval)
- func (inc *NRR) EmitUpdate(value float64)
- func (inc *NRR) Index(i int) float64
- func (inc *NRR) Last(i int) float64
- func (inc *NRR) Length() int
- func (inc *NRR) LoadK(allKLines []types.KLine)
- func (inc *NRR) OnUpdate(cb func(value float64))
- func (inc *NRR) PushK(k types.KLine)
- func (inc *NRR) Update(openPrice, closePrice float64)
- type Strategy
- func (s *Strategy) CalcAssetValue(price fixedpoint.Value) fixedpoint.Value
- func (s *Strategy) Draw(profit, cumProfit types.Series) error
- func (s *Strategy) ID() string
- func (s *Strategy) InitDrawCommands(profit, cumProfit, cumProfitDollar types.Series)
- func (s *Strategy) InstanceID() string
- func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, ...) error
- func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Constants ¶
View Source
const ID = "irr"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccumulatedProfitReport ¶
type AccumulatedProfitReport struct { // AccumulatedProfitMAWindow Accumulated profit SMA window, in number of trades AccumulatedProfitMAWindow int `json:"accumulatedProfitMAWindow"` // IntervalWindow interval window, in days IntervalWindow int `json:"intervalWindow"` // NumberOfInterval How many intervals to output to TSV NumberOfInterval int `json:"NumberOfInterval"` // TsvReportPath The path to output report to TsvReportPath string `json:"tsvReportPath"` // AccumulatedDailyProfitWindow The window to sum up the daily profit, in days AccumulatedDailyProfitWindow int `json:"accumulatedDailyProfitWindow"` // contains filtered or unexported fields }
AccumulatedProfitReport For accumulated profit report output
func (*AccumulatedProfitReport) DailyUpdate ¶
func (r *AccumulatedProfitReport) DailyUpdate(tradeStats *types.TradeStats)
func (*AccumulatedProfitReport) Initialize ¶
func (r *AccumulatedProfitReport) Initialize()
func (*AccumulatedProfitReport) Output ¶
func (r *AccumulatedProfitReport) Output(symbol string)
Output Accumulated profit report to a TSV file
func (*AccumulatedProfitReport) RecordProfit ¶
func (r *AccumulatedProfitReport) RecordProfit(profit fixedpoint.Value)
func (*AccumulatedProfitReport) RecordTrade ¶
func (r *AccumulatedProfitReport) RecordTrade(fee fixedpoint.Value)
type NRR ¶
type NRR struct { types.IntervalWindow types.SeriesBase RankingWindow int Values floats.Slice RankedValues floats.Slice ReturnValues floats.Slice EndTime time.Time // contains filtered or unexported fields }
func (*NRR) EmitUpdate ¶
type Strategy ¶
type Strategy struct { Environment *bbgo.Environment Symbol string `json:"symbol"` Market types.Market types.IntervalWindow // persistence fields Position *types.Position `persistence:"position"` ProfitStats *types.ProfitStats `persistence:"profit_stats"` TradeStats *types.TradeStats `persistence:"trade_stats"` ExitMethods bbgo.ExitMethodSet `json:"exits"` bbgo.QuantityOrAmount // StrategyController bbgo.StrategyController AccountValueCalculator *bbgo.AccountValueCalculator // whether to draw graph or not by the end of backtest DrawGraph bool `json:"drawGraph"` GraphPNLPath string `json:"graphPNLPath"` GraphCumPNLPath string `json:"graphCumPNLPath"` // Accumulated profit report AccumulatedProfitReport *AccumulatedProfitReport `json:"accumulatedProfitReport"` // contains filtered or unexported fields }
func (*Strategy) CalcAssetValue ¶
func (s *Strategy) CalcAssetValue(price fixedpoint.Value) fixedpoint.Value
func (*Strategy) InitDrawCommands ¶
func (*Strategy) InstanceID ¶
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.