xalign

package
v1.62.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2025 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "xalign"

Variables

This section is empty.

Functions

This section is empty.

Types

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) SlackAttachment added in v1.62.0

func (m *CriticalBalanceDiscrepancyAlert) SlackAttachment() slack.Attachment

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 QuoteCurrencyPreference

type QuoteCurrencyPreference struct {
	Buy  []string `json:"buy"`
	Sell []string `json:"sell"`
}

type Strategy

type Strategy struct {
	*bbgo.Environment
	Interval                 types.Interval              `json:"interval"`
	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"`

	WarningDuration types.Duration `json:"warningFor"`

	MaxAmounts       map[string]fixedpoint.Value `json:"maxAmounts"`
	LargeAmountAlert *LargeAmountAlertConfig     `json:"largeAmountAlert"`

	SlackNotify                bool             `json:"slackNotify"`
	SlackNotifyMentions        []string         `json:"slackNotifyMentions"`
	SlackNotifyThresholdAmount fixedpoint.Value `json:"slackNotifyThresholdAmount,omitempty"`
	// 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) Defaults added in v1.49.0

func (s *Strategy) Defaults() error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) Initialize added in v1.61.0

func (s *Strategy) Initialize() error

func (*Strategy) InstanceID

func (s *Strategy) InstanceID() string

func (*Strategy) Subscribe

func (s *Strategy) Subscribe(session *bbgo.ExchangeSession)

func (*Strategy) Validate

func (s *Strategy) Validate() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL