Documentation ¶
Index ¶
- Constants
- type GeneralOrderExecutorMap
- func (m GeneralOrderExecutorMap) Bind()
- func (m GeneralOrderExecutorMap) BindEnvironment(environ *bbgo.Environment)
- func (m GeneralOrderExecutorMap) BindProfitStats(profitStatsMap ProfitStatsMap)
- func (m GeneralOrderExecutorMap) GracefulCancel(ctx context.Context) error
- func (m GeneralOrderExecutorMap) SubmitOrders(ctx context.Context, submitOrders ...types.SubmitOrder) (types.OrderSlice, error)
- type MultiMarketStrategy
- type PositionMap
- type ProfitStatsMap
- type Strategy
- func (s *Strategy) Defaults() error
- func (s *Strategy) ID() string
- func (s *Strategy) Initialize() error
- func (s *Strategy) InstanceID() string
- func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.ExchangeSession) error
- func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
- func (s *Strategy) Validate() error
Constants ¶
View Source
const ID = "rebalance"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GeneralOrderExecutorMap ¶ added in v1.44.0
type GeneralOrderExecutorMap map[string]*bbgo.GeneralOrderExecutor
func NewGeneralOrderExecutorMap ¶ added in v1.44.0
func NewGeneralOrderExecutorMap(session *bbgo.ExchangeSession, strategyID string, instanceID string, positionMap PositionMap) GeneralOrderExecutorMap
func (GeneralOrderExecutorMap) Bind ¶ added in v1.44.0
func (m GeneralOrderExecutorMap) Bind()
func (GeneralOrderExecutorMap) BindEnvironment ¶ added in v1.44.0
func (m GeneralOrderExecutorMap) BindEnvironment(environ *bbgo.Environment)
func (GeneralOrderExecutorMap) BindProfitStats ¶ added in v1.44.0
func (m GeneralOrderExecutorMap) BindProfitStats(profitStatsMap ProfitStatsMap)
func (GeneralOrderExecutorMap) GracefulCancel ¶ added in v1.44.0
func (m GeneralOrderExecutorMap) GracefulCancel(ctx context.Context) error
func (GeneralOrderExecutorMap) SubmitOrders ¶ added in v1.44.0
func (m GeneralOrderExecutorMap) SubmitOrders(ctx context.Context, submitOrders ...types.SubmitOrder) (types.OrderSlice, error)
type MultiMarketStrategy ¶ added in v1.53.0
type MultiMarketStrategy struct { Environ *bbgo.Environment Session *bbgo.ExchangeSession PositionMap PositionMap `persistence:"position_map"` ProfitStatsMap ProfitStatsMap `persistence:"profit_stats_map"` OrderExecutorMap GeneralOrderExecutorMap // contains filtered or unexported fields }
func (*MultiMarketStrategy) Initialize ¶ added in v1.53.0
func (s *MultiMarketStrategy) Initialize(ctx context.Context, environ *bbgo.Environment, session *bbgo.ExchangeSession, markets map[string]types.Market, strategyID string, instanceID string)
type PositionMap ¶ added in v1.44.0
type ProfitStatsMap ¶ added in v1.44.0
type ProfitStatsMap map[string]*types.ProfitStats
type Strategy ¶
type Strategy struct { *MultiMarketStrategy Environment *bbgo.Environment Schedule string `json:"schedule"` QuoteCurrency string `json:"quoteCurrency"` TargetWeights types.ValueMap `json:"targetWeights"` Threshold fixedpoint.Value `json:"threshold"` MaxAmount fixedpoint.Value `json:"maxAmount"` // max amount to buy or sell per order OrderType types.OrderType `json:"orderType"` PriceType types.PriceType `json:"priceType"` BalanceType types.BalanceType `json:"balanceType"` DryRun bool `json:"dryRun"` OnStart bool `json:"onStart"` // rebalance on start // contains filtered or unexported fields }
func (*Strategy) Initialize ¶ added in v1.30.1
func (*Strategy) InstanceID ¶ added in v1.56.0
func (*Strategy) Run ¶
func (s *Strategy) Run(ctx context.Context, _ 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.