spreadmonitor

package
v0.0.0-...-a7cd9b2 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ID = "spreadmonitor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Strategy

type Strategy struct {
	*bbgo.Notifiability

	Config []StrategyConfig
	// 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) ID

func (s *Strategy) ID() string

func (*Strategy) UnmarshalJSON

func (s *Strategy) UnmarshalJSON(data []byte) error

type StrategyConfig

type StrategyConfig struct {
	SourceExchange         string  `json:"sourceExchange"`
	SourceExchangeTakerFee float64 `json:"sourceExchangeTakerFee,omitempty"`
	SourceExchangeSide     string  `json:"sourceExchangeSide"`
	SourceExchangeMarket   string  `json:"sourceExchangeMarket"`

	TargetExchange         string  `json:"targetExchange"`
	TargetExchangeTakerFee float64 `json:"targetExchangeTakerFee,omitempty"`
	TargetExchangeSide     string  `json:"targetExchangeSide"`
	TargetExchangeMarket   string  `json:"targetExchangeMarket"`

	UpperLimitMessage   string `json:"upperLimitMessage,omitempty"`
	SpreadUpperLimitBps int64  `json:"spreadUpperLimitBps,omitempty"`
	AboveLimitDuration  time.Duration
	LowerLimitMessage   string `json:"lowerLimitMessage,omitempty"`
	SpreadLowerLimitBps int64  `json:"spreadLowerLimitBps,omitempty"`
	BelowLimitDuration  time.Duration

	SlackChannelName string `json:"slackChannelName"`
	QuietDuration    time.Duration
}

func (*StrategyConfig) UnmarshalJSON

func (c *StrategyConfig) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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