pivotshort

package
v1.33.2 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const ID = "pivotshort"

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Immediate        bool                            `json:"immediate"`
	CatBounceRatio   fixedpoint.Value                `json:"catBounceRatio"`
	Quantity         fixedpoint.Value                `json:"quantity"`
	NumLayers        int                             `json:"numLayers"`
	MarginSideEffect types.MarginOrderSideEffectType `json:"marginOrderSideEffect"`
}

type Exit

type Exit struct {
	TakeProfitPercentage fixedpoint.Value                `json:"takeProfitPercentage"`
	StopLossPercentage   fixedpoint.Value                `json:"stopLossPercentage"`
	ShadowTPRatio        fixedpoint.Value                `json:"shadowTakeProfitRatio"`
	MarginSideEffect     types.MarginOrderSideEffectType `json:"marginOrderSideEffect"`
}

type IntervalWindowSetting

type IntervalWindowSetting struct {
	types.IntervalWindow
}

type Strategy

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

	Environment   *bbgo.Environment
	Symbol        string `json:"symbol"`
	Market        types.Market
	Interval      types.Interval   `json:"interval"`
	TotalQuantity fixedpoint.Value `json:"totalQuantity"`

	// persistence fields
	Position    *types.Position    `json:"position,omitempty" persistence:"position"`
	ProfitStats *types.ProfitStats `json:"profitStats,omitempty" persistence:"profit_stats"`

	PivotLength int `json:"pivotLength"`
	LastLow     fixedpoint.Value

	Entry Entry
	Exit  Exit

	// StrategyController
	bbgo.StrategyController
	// contains filtered or unexported fields
}

func (*Strategy) ClosePosition

func (s *Strategy) ClosePosition(ctx context.Context, percentage fixedpoint.Value) error

func (*Strategy) ID

func (s *Strategy) ID() string

func (*Strategy) InstanceID

func (s *Strategy) InstanceID() string

func (*Strategy) Run

func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, session *bbgo.ExchangeSession) error

func (*Strategy) Subscribe

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

Jump to

Keyboard shortcuts

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