script

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoMethod = errors.New("no such method")
)
View Source
var (
	SkipStructs = map[string]bool{
		"DepthInfo":  true,
		"CandleList": true,
		"Currency":   true,
		"Symbol":     true,
		"Candle":     true,
		"Order":      true,
		"Trade":      true,
		"Balance":    true,
		"Param":      true,
	}
)

Functions

func NewRunnerExport

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

Types

type CallInfo

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

func NewCallInfo

func NewCallInfo(p *fast.Interp, name string, t xreflect.Type) (ci *CallInfo, err error)

func (*CallInfo) Init

func (ci *CallInfo) Init(engine bengine.Engine, data common.ParamData) (err error)

func (*CallInfo) OnCandle

func (ci *CallInfo) OnCandle(candle *Candle) (err error)

func (*CallInfo) OnDepth

func (ci *CallInfo) OnDepth(depth *Depth) (err error)

func (*CallInfo) OnEvent

func (ci *CallInfo) OnEvent(e *Event) (err error)

func (*CallInfo) OnPosition

func (ci *CallInfo) OnPosition(pos, price float64) (err error)

func (*CallInfo) OnTrade

func (ci *CallInfo) OnTrade(trade *Trade) (err error)

func (*CallInfo) OnTradeMarket added in v0.0.5

func (ci *CallInfo) OnTradeMarket(trade *Trade) (err error)

func (*CallInfo) Param

func (ci *CallInfo) Param() (paramInfo []common.Param, err error)

type P_CommonIndicator added in v0.0.6

type P_CommonIndicator struct {
	Object     interface{}
	Indicator_ func(interface{}) map[string]float64
	Result_    func(interface{}) float64
	Update_    func(_proxy_obj_ interface{}, price float64)
}

--------------- proxy for github.com/ztrade/indicator.CommonIndicator ---------------

func (*P_CommonIndicator) Indicator added in v0.0.6

func (P *P_CommonIndicator) Indicator() map[string]float64

func (*P_CommonIndicator) Result added in v0.0.6

func (P *P_CommonIndicator) Result() float64

func (*P_CommonIndicator) Update added in v0.0.6

func (P *P_CommonIndicator) Update(price float64)

type P_Crosser added in v0.0.6

type P_Crosser struct {
	Object      interface{}
	FastResult_ func(interface{}) float64
	SlowResult_ func(interface{}) float64
	Update_     func(_proxy_obj_ interface{}, price float64)
}

--------------- proxy for github.com/ztrade/indicator.Crosser ---------------

func (*P_Crosser) FastResult added in v0.0.6

func (P *P_Crosser) FastResult() float64

func (*P_Crosser) SlowResult added in v0.0.6

func (P *P_Crosser) SlowResult() float64

func (*P_Crosser) Update added in v0.0.6

func (P *P_Crosser) Update(price float64)

type P_Indicator added in v0.0.6

type P_Indicator struct {
	Object  interface{}
	Result_ func(interface{}) float64
	Update_ func(_proxy_obj_ interface{}, price float64)
}

--------------- proxy for github.com/ztrade/indicator.Indicator ---------------

func (*P_Indicator) Result added in v0.0.6

func (P *P_Indicator) Result() float64

func (*P_Indicator) Update added in v0.0.6

func (P *P_Indicator) Update(price float64)

type P_Updater added in v0.0.6

type P_Updater struct {
	Object  interface{}
	Update_ func(_proxy_obj_ interface{}, price float64)
}

--------------- proxy for github.com/ztrade/indicator.Updater ---------------

func (*P_Updater) Update added in v0.0.6

func (P *P_Updater) Update(price float64)

type Runner

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

func NewRunner

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

func (*Runner) GetName

func (r *Runner) GetName() string

func (*Runner) Init

func (r *Runner) Init(engine bengine.Engine, params common.ParamData) (err error)

func (*Runner) OnCandle

func (r *Runner) OnCandle(candle *Candle) (err error)

func (*Runner) OnDepth

func (r *Runner) OnDepth(depth *Depth) (err error)

func (*Runner) OnEvent

func (r *Runner) OnEvent(e *Event) (err error)

func (*Runner) OnPosition

func (r *Runner) OnPosition(pos, price float64) (err error)

func (*Runner) OnTrade

func (r *Runner) OnTrade(trade *Trade) (err error)

func (*Runner) OnTradeMarket added in v0.0.5

func (r *Runner) OnTradeMarket(trade *Trade) (err error)

func (*Runner) Param

func (r *Runner) Param() (paramInfo []common.Param, err error)

Jump to

Keyboard shortcuts

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