engine

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngine

func NewEngine(proc *BaseProcesser) engine.Engine

func Register

func Register(ext string, fn NewRunnerFn)

Types

type EngineImpl added in v0.0.2

type EngineImpl struct {
	// contains filtered or unexported fields
}

func (*EngineImpl) AddIndicator added in v0.0.2

func (e *EngineImpl) AddIndicator(name string, params ...int) (ind indicator.CommonIndicator)

func (*EngineImpl) Balance added in v0.0.2

func (e *EngineImpl) Balance() (balance float64)

func (*EngineImpl) CancelAllOrder added in v0.0.2

func (e *EngineImpl) CancelAllOrder()

func (*EngineImpl) CloseLong added in v0.0.2

func (e *EngineImpl) CloseLong(price, amount float64)

func (*EngineImpl) CloseShort added in v0.0.2

func (e *EngineImpl) CloseShort(price, amount float64)

func (*EngineImpl) Log added in v0.0.2

func (e *EngineImpl) Log(v ...interface{})

func (*EngineImpl) Merge added in v0.0.2

func (e *EngineImpl) Merge(src, dst string, fn common.CandleFn)

func (*EngineImpl) OnCandle added in v0.0.2

func (e *EngineImpl) OnCandle(candle Candle)

func (*EngineImpl) OpenLong added in v0.0.2

func (e *EngineImpl) OpenLong(price, amount float64)

func (*EngineImpl) OpenShort added in v0.0.2

func (e *EngineImpl) OpenShort(price, amount float64)

func (*EngineImpl) Position added in v0.0.2

func (e *EngineImpl) Position() (float64, float64)

func (*EngineImpl) SendNotify added in v0.0.2

func (e *EngineImpl) SendNotify(content, contentType string)

func (*EngineImpl) SetBalance added in v0.0.2

func (e *EngineImpl) SetBalance(balance float64)

func (*EngineImpl) StopLong added in v0.0.2

func (e *EngineImpl) StopLong(price, amount float64)

func (*EngineImpl) StopShort added in v0.0.2

func (e *EngineImpl) StopShort(price, amount float64)

func (*EngineImpl) UpdateBalance added in v0.0.2

func (e *EngineImpl) UpdateBalance(balance float64)

func (*EngineImpl) UpdatePosition added in v0.0.2

func (e *EngineImpl) UpdatePosition(pos, price float64)

func (*EngineImpl) Watch added in v0.0.2

func (e *EngineImpl) Watch(watchType string)

type KlinePlugin

type KlinePlugin struct {
	// contains filtered or unexported fields
}

func NewKlinePlugin

func NewKlinePlugin(src, dst string, fn common.CandleFn) (kp *KlinePlugin)

func (*KlinePlugin) Update

func (kp *KlinePlugin) Update(candle Candle)

type NewRunnerFn

type NewRunnerFn func(file string) (r Runner, err error)

type Runner

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

func NewRunner

func NewRunner(file string) (r Runner, err error)

Jump to

Keyboard shortcuts

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