xmaker

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

View Source
const ID = "xmaker"

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	HedgePosition fixedpoint.Value `json:"hedgePosition"`
}

type Strategy

type Strategy struct {
	*bbgo.Graceful
	*bbgo.Notifiability
	*bbgo.Persistence

	Symbol         string `json:"symbol"`
	SourceExchange string `json:"sourceExchange"`
	MakerExchange  string `json:"makerExchange"`

	UpdateInterval types.Duration `json:"updateInterval"`
	HedgeInterval  types.Duration `json:"hedgeInterval"`

	Margin              fixedpoint.Value `json:"margin"`
	BidMargin           fixedpoint.Value `json:"bidMargin"`
	AskMargin           fixedpoint.Value `json:"askMargin"`
	Quantity            fixedpoint.Value `json:"quantity"`
	QuantityMultiplier  fixedpoint.Value `json:"quantityMultiplier"`
	MaxExposurePosition fixedpoint.Value `json:"maxExposurePosition"`
	DisableHedge        bool             `json:"disableHedge"`

	NumLayers int `json:"numLayers"`
	Pips      int `json:"pips"`
	// 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) Hedge

func (s *Strategy) Hedge(ctx context.Context, pos fixedpoint.Value)

func (*Strategy) ID

func (s *Strategy) ID() string

Jump to

Keyboard shortcuts

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