Documentation ¶
Index ¶
- func SyncActiveOrder(ctx context.Context, ex types.Exchange, ...) (isOrderUpdated bool, err error)
- func SyncActiveOrders(ctx context.Context, opts SyncActiveOrdersOpts) error
- type ProfitFixer
- func (f *ProfitFixer) AddExchange(sessionName string, service types.ExchangeTradeHistoryService)
- func (f *ProfitFixer) Fix(ctx context.Context, symbol string, since, until time.Time, ...) error
- func (f *ProfitFixer) FixFromTrades(allTrades []types.Trade, stats *types.ProfitStats, position *types.Position) error
- type ProfitFixerConfig
- type RiskController
- type StatusCallbacks
- type Strategy
- type SyncActiveOrdersOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SyncActiveOrder ¶ added in v1.58.0
func SyncActiveOrders ¶ added in v1.58.0
func SyncActiveOrders(ctx context.Context, opts SyncActiveOrdersOpts) error
Types ¶
type ProfitFixer ¶ added in v1.58.0
type ProfitFixer struct {
// contains filtered or unexported fields
}
ProfitFixer implements a trade-history-based profit fixer
func NewProfitFixer ¶ added in v1.58.0
func NewProfitFixer() *ProfitFixer
func (*ProfitFixer) AddExchange ¶ added in v1.58.0
func (f *ProfitFixer) AddExchange(sessionName string, service types.ExchangeTradeHistoryService)
func (*ProfitFixer) FixFromTrades ¶ added in v1.58.0
func (f *ProfitFixer) FixFromTrades(allTrades []types.Trade, stats *types.ProfitStats, position *types.Position) error
type ProfitFixerConfig ¶ added in v1.58.0
ProfitFixerConfig is used for fixing profitStats and position by re-playing the trade history
type RiskController ¶
type RiskController struct { PositionHardLimit fixedpoint.Value `json:"positionHardLimit"` MaxPositionQuantity fixedpoint.Value `json:"maxPositionQuantity"` CircuitBreakLossThreshold fixedpoint.Value `json:"circuitBreakLossThreshold"` CircuitBreakEMA types.IntervalWindow `json:"circuitBreakEMA"` // contains filtered or unexported fields }
type StatusCallbacks ¶ added in v1.56.0
type StatusCallbacks struct {
// contains filtered or unexported fields
}
func (*StatusCallbacks) EmitClosed ¶ added in v1.56.0
func (c *StatusCallbacks) EmitClosed()
func (*StatusCallbacks) EmitError ¶ added in v1.56.0
func (c *StatusCallbacks) EmitError(err error)
func (*StatusCallbacks) EmitReady ¶ added in v1.56.0
func (c *StatusCallbacks) EmitReady()
func (*StatusCallbacks) OnClosed ¶ added in v1.56.0
func (c *StatusCallbacks) OnClosed(cb func())
func (*StatusCallbacks) OnError ¶ added in v1.56.0
func (c *StatusCallbacks) OnError(cb func(err error))
func (*StatusCallbacks) OnReady ¶ added in v1.56.0
func (c *StatusCallbacks) OnReady(cb func())
type Strategy ¶
type Strategy struct { Position *types.Position `json:"position,omitempty" persistence:"position"` ProfitStats *types.ProfitStats `json:"profitStats,omitempty" persistence:"profit_stats"` Environ *bbgo.Environment Session *bbgo.ExchangeSession OrderExecutor *bbgo.GeneralOrderExecutor RiskController // contains filtered or unexported fields }
Strategy provides the core functionality that is required by a long/short strategy.
func (*Strategy) Initialize ¶
func (s *Strategy) Initialize(ctx context.Context, environ *bbgo.Environment, session *bbgo.ExchangeSession, market types.Market, strategyID, instanceID string)
type SyncActiveOrdersOpts ¶ added in v1.58.0
type SyncActiveOrdersOpts struct { Logger *logrus.Entry Exchange types.Exchange OrderQueryService types.ExchangeOrderQueryService ActiveOrderBook *bbgo.ActiveOrderBook OpenOrders []types.Order }
Click to show internal directories.
Click to hide internal directories.