Documentation
¶
Index ¶
- Constants
- type BudgetPeriod
- type Strategy
- func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error
- func (s *Strategy) ID() string
- 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 = "dca"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BudgetPeriod ¶
type BudgetPeriod string
const ( BudgetPeriodDay BudgetPeriod = "day" BudgetPeriodWeek BudgetPeriod = "week" BudgetPeriodMonth BudgetPeriod = "month" )
func (BudgetPeriod) Duration ¶
func (b BudgetPeriod) Duration() time.Duration
type Strategy ¶
type Strategy struct {
*bbgo.Graceful
*bbgo.Notifiability
*bbgo.Persistence
Environment *bbgo.Environment
Symbol string `json:"symbol"`
Market types.Market
// BudgetPeriod is how long your budget quota will be reset.
// day, week, month
BudgetPeriod BudgetPeriod `json:"budgetPeriod"`
// Budget is the amount you invest per budget period
Budget fixedpoint.Value `json:"budget"`
// InvestmentInterval is the interval of each investment
InvestmentInterval types.Interval `json:"investmentInterval"`
Position *types.Position `persistence:"position"`
ProfitStats *types.ProfitStats `persistence:"profit_stats"`
BudgetQuota fixedpoint.Value `persistence:"budget_quota"`
BudgetPeriodStartTime time.Time `persistence:"budget_period_start_time"`
bbgo.StrategyController
// contains filtered or unexported fields
}
Strategy is the Dollar-Cost-Average strategy
func (*Strategy) ClosePosition ¶
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.