Documentation
¶
Index ¶
- Constants
- type AssetTransfer
- type CriticalBalanceDiscrepancyAlert
- type InteractiveOrderConfig
- type InteractiveSubmitOrder
- type LargeAmountAlertConfig
- type OnSubmittedOrderCallback
- type QuoteCurrencyPreference
- type Strategy
- func (s *Strategy) CrossRun(ctx context.Context, _ bbgo.OrderExecutionRouter, ...) error
- func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession)
- func (s *Strategy) Defaults() error
- func (s *Strategy) ID() string
- func (s *Strategy) Initialize() error
- func (s *Strategy) InstanceID() string
- func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
- func (s *Strategy) Validate() error
Constants ¶
View Source
const ID = "xalign"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AssetTransfer ¶ added in v1.64.0
func (*AssetTransfer) SlackAttachment ¶ added in v1.64.0
func (at *AssetTransfer) SlackAttachment() slack.Attachment
type CriticalBalanceDiscrepancyAlert ¶ added in v1.62.0
type CriticalBalanceDiscrepancyAlert struct {
SlackAlert *slackalert.SlackAlert
Warning bool
BaseCurrency string
Delta fixedpoint.Value
SustainedDuration time.Duration
QuoteCurrency string
AlertAmount fixedpoint.Value
Side types.SideType
Price fixedpoint.Value
Quantity fixedpoint.Value
Amount fixedpoint.Value
}
func (*CriticalBalanceDiscrepancyAlert) Comment ¶ added in v1.64.0
func (m *CriticalBalanceDiscrepancyAlert) Comment() *livenote.OptionComment
func (*CriticalBalanceDiscrepancyAlert) ObjectID ¶ added in v1.64.0
func (m *CriticalBalanceDiscrepancyAlert) ObjectID() string
func (*CriticalBalanceDiscrepancyAlert) SlackAttachment ¶ added in v1.62.0
func (m *CriticalBalanceDiscrepancyAlert) SlackAttachment() slack.Attachment
func (*CriticalBalanceDiscrepancyAlert) WarnComment ¶ added in v1.64.0
func (m *CriticalBalanceDiscrepancyAlert) WarnComment() *livenote.OptionComment
type InteractiveOrderConfig ¶ added in v1.64.0
type InteractiveOrderConfig struct {
Enabled bool `json:"enabled"`
// Delay is the delay duration for interactive order confirmation in Slack
Delay types.Duration `json:"delay"`
// MinAmount is the minimum amount required for interactive order confirmation in Slack
MinAmount fixedpoint.Value `json:"minAmount"`
}
type InteractiveSubmitOrder ¶ added in v1.64.0
type InteractiveSubmitOrder struct {
sync.Mutex
CancelOnce func()
ConfirmOnce func()
// contains filtered or unexported fields
}
func NewInteractiveSubmitOrder ¶ added in v1.64.0
func NewInteractiveSubmitOrder(order types.SubmitOrder, delay time.Duration, mentions []string, slackEvtID string) *InteractiveSubmitOrder
func (*InteractiveSubmitOrder) AsyncSubmit ¶ added in v1.64.0
func (itOrder *InteractiveSubmitOrder) AsyncSubmit(ctx context.Context, session *bbgo.ExchangeSession, onSubmittedOrderCallback OnSubmittedOrderCallback)
func (*InteractiveSubmitOrder) SetHelpMessage ¶ added in v1.64.0
func (itOrder *InteractiveSubmitOrder) SetHelpMessage(msg string)
func (*InteractiveSubmitOrder) SlackBlocks ¶ added in v1.64.0
func (itOrder *InteractiveSubmitOrder) SlackBlocks() []slack.Block
type LargeAmountAlertConfig ¶ added in v1.61.0
type LargeAmountAlertConfig struct {
Slack *slackalert.SlackAlert `json:"slack"`
QuoteCurrency string `json:"quoteCurrency"`
Amount fixedpoint.Value `json:"amount"`
}
type OnSubmittedOrderCallback ¶ added in v1.64.0
type OnSubmittedOrderCallback func(*bbgo.ExchangeSession, *types.SubmitOrder, *types.Order, error)
OnSubmittedOrderCallback is the callback function type on order submitted event Parameters: - session: the exchange session used to submit the order - submitOrder: the original submit order request - order: the created order, nil if error occurs - error: error if any during order submission
type QuoteCurrencyPreference ¶
type Strategy ¶
type Strategy struct {
*bbgo.Environment
ActiveTransferInterval types.Duration `json:"interval"` // keep the same tag name for backward compatibility
IdleInterval *types.Duration `json:"idleInterval,omitempty"`
PreferredSessions []string `json:"sessions"`
PreferredQuoteCurrencies *QuoteCurrencyPreference `json:"quoteCurrencies"`
ExpectedBalances map[string]fixedpoint.Value `json:"expectedBalances"`
UseTakerOrder bool `json:"useTakerOrder"`
DryRun bool `json:"dryRun"`
BalanceToleranceRange fixedpoint.Value `json:"balanceToleranceRange"`
Duration types.Duration `json:"for"`
InstantAlignAmount fixedpoint.Value `json:"instantAlignAmount"`
Disabled bool `json:"disabled"`
InteractiveOrderConfig *InteractiveOrderConfig `json:"interactiveOrder,omitempty"`
WarningDuration types.Duration `json:"warningFor"`
SkipTransferCheck bool `json:"skipTransferCheck"`
MaxQuantity map[string]fixedpoint.Value `json:"maxQuantity"`
LargeAmountAlert *LargeAmountAlertConfig `json:"largeAmountAlert"`
SlackNotify bool `json:"slackNotify"`
SlackNotifyMentions []string `json:"slackNotifyMentions"`
SlackNotifyThresholdAmount fixedpoint.Value `json:"slackNotifyThresholdAmount,omitempty"`
SkipAlignOnAnyActiveTransfer bool `json:"skipAlignOnAnyActiveTransfer"`
ActiveTransferTimeWindow types.Duration `json:"activeTransferTimeWindow"`
// contains filtered or unexported fields
}
func (*Strategy) CrossRun ¶
func (s *Strategy) CrossRun( ctx context.Context, _ bbgo.OrderExecutionRouter, sessions map[string]*bbgo.ExchangeSession, ) error
func (*Strategy) CrossSubscribe ¶
func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession)
func (*Strategy) Initialize ¶ added in v1.61.0
func (*Strategy) InstanceID ¶
func (*Strategy) Subscribe ¶
func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)
Click to show internal directories.
Click to hide internal directories.