plugin

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPlugin

func NewPlugin(file string) (r engine.Runner, err error)

Types

type Runner

type Runner interface {
	Param() (paramInfo []common.Param)
	Init(engine engine.Engine, params common.ParamData)
	OnCandle(candle Candle)
	OnPosition(pos, price float64)
	OnTrade(trade Trade)
	OnTradeHistory(trade Trade)
	OnDepth(depth Depth)
}

type StrategyPlugin

type StrategyPlugin struct {
	Runner
	// contains filtered or unexported fields
}

func (*StrategyPlugin) GetName

func (sp *StrategyPlugin) GetName() string

func (*StrategyPlugin) Init

func (sp *StrategyPlugin) Init(engine bengine.Engine, params common.ParamData) (err error)

func (*StrategyPlugin) OnCandle

func (sp *StrategyPlugin) OnCandle(candle Candle) (err error)

func (*StrategyPlugin) OnDepth

func (sp *StrategyPlugin) OnDepth(depth Depth) (err error)

func (*StrategyPlugin) OnEvent

func (sp *StrategyPlugin) OnEvent(e Event) (err error)

func (*StrategyPlugin) OnPosition

func (sp *StrategyPlugin) OnPosition(pos, price float64) (err error)

func (*StrategyPlugin) OnTrade

func (sp *StrategyPlugin) OnTrade(trade Trade) (err error)

func (*StrategyPlugin) OnTradeHistory

func (sp *StrategyPlugin) OnTradeHistory(trade Trade) (err error)

func (*StrategyPlugin) Param

func (sp *StrategyPlugin) Param() (paramInfo []common.Param, err error)

Jump to

Keyboard shortcuts

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