engine

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(ext string, fn NewRunnerFn)

Types

type Engine

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

func NewEngine

func NewEngine(proc *BaseProcesser) (e *Engine)

func (*Engine) AddIndicator

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

func (*Engine) Balance

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

func (*Engine) CancelAllOrder

func (e *Engine) CancelAllOrder()

func (*Engine) CloseLong

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

func (*Engine) CloseShort

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

func (*Engine) Log

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

func (*Engine) Merge

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

func (*Engine) OnCandle

func (e *Engine) OnCandle(candle Candle)

func (*Engine) OpenLong

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

func (*Engine) OpenShort

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

func (*Engine) Position

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

func (*Engine) SendNotify

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

func (*Engine) SetBalance

func (e *Engine) SetBalance(balance float64)

func (*Engine) StopLong

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

func (*Engine) StopShort

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

func (*Engine) UpdateBalance

func (e *Engine) UpdateBalance(balance float64)

func (*Engine) UpdatePosition

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

func (*Engine) Watch

func (e *Engine) 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, 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