Documentation ¶
Index ¶
- Constants
- type ProfitStats
- type State
- type Strategy
- func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.OrderExecutionRouter, ...) error
- func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession)
- func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value)
- func (s *Strategy) ID() string
- func (s *Strategy) LoadState() error
- func (s *Strategy) SaveState() error
- func (s *Strategy) Validate() error
Constants ¶
View Source
const ID = "xmaker"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProfitStats ¶ added in v1.17.0
type ProfitStats struct { bbgo.ProfitStats MakerExchange types.ExchangeName `json:"makerExchange"` AccumulatedMakerVolume fixedpoint.Value `json:"accumulatedMakerVolume,omitempty"` AccumulatedMakerBidVolume fixedpoint.Value `json:"accumulatedMakerBidVolume,omitempty"` AccumulatedMakerAskVolume fixedpoint.Value `json:"accumulatedMakerAskVolume,omitempty"` TodayMakerVolume fixedpoint.Value `json:"todayMakerVolume,omitempty"` TodayMakerBidVolume fixedpoint.Value `json:"todayMakerBidVolume,omitempty"` TodayMakerAskVolume fixedpoint.Value `json:"todayMakerAskVolume,omitempty"` }
func (*ProfitStats) AddTrade ¶ added in v1.17.0
func (s *ProfitStats) AddTrade(trade types.Trade)
func (*ProfitStats) ResetToday ¶ added in v1.17.0
func (s *ProfitStats) ResetToday()
type State ¶
type State struct { HedgePosition fixedpoint.Value `json:"hedgePosition"` CoveredPosition fixedpoint.Value `json:"coveredPosition,omitempty"` Position *types.Position `json:"position,omitempty"` ProfitStats ProfitStats `json:"profitStats,omitempty"` }
type Strategy ¶
type Strategy struct { *bbgo.Graceful *bbgo.Notifiability *bbgo.Persistence Symbol string `json:"symbol"` // SourceExchange session name SourceExchange string `json:"sourceExchange"` // MakerExchange session name MakerExchange string `json:"makerExchange"` UpdateInterval types.Duration `json:"updateInterval"` HedgeInterval types.Duration `json:"hedgeInterval"` OrderCancelWaitTime types.Duration `json:"orderCancelWaitTime"` Margin fixedpoint.Value `json:"margin"` BidMargin fixedpoint.Value `json:"bidMargin"` AskMargin fixedpoint.Value `json:"askMargin"` UseDepthPrice bool `json:"useDepthPrice"` EnableBollBandMargin bool `json:"enableBollBandMargin"` BollBandInterval types.Interval `json:"bollBandInterval"` BollBandMargin fixedpoint.Value `json:"bollBandMargin"` BollBandMarginFactor fixedpoint.Value `json:"bollBandMarginFactor"` StopHedgeQuoteBalance fixedpoint.Value `json:"stopHedgeQuoteBalance"` StopHedgeBaseBalance fixedpoint.Value `json:"stopHedgeBaseBalance"` // Quantity is used for fixed quantity of the first layer Quantity fixedpoint.Value `json:"quantity"` // QuantityMultiplier is the factor that multiplies the quantity of the previous layer QuantityMultiplier fixedpoint.Value `json:"quantityMultiplier"` // QuantityScale helps user to define the quantity by layer scale QuantityScale *bbgo.LayerScale `json:"quantityScale,omitempty"` // MaxExposurePosition defines the unhedged quantity of stop MaxExposurePosition fixedpoint.Value `json:"maxExposurePosition"` DisableHedge bool `json:"disableHedge"` NotifyTrade bool `json:"notifyTrade"` NumLayers int `json:"numLayers"` // Pips is the pips of the layer prices Pips fixedpoint.Value `json:"pips"` // contains filtered or unexported fields }
func (*Strategy) CrossRun ¶
func (s *Strategy) CrossRun(ctx context.Context, orderExecutionRouter bbgo.OrderExecutionRouter, sessions map[string]*bbgo.ExchangeSession) error
func (*Strategy) CrossSubscribe ¶
func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.