Documentation
¶
Index ¶
- func Register(ext string, fn NewRunnerFn)
- type Engine
- func (e *Engine) AddIndicator(name string, params ...int) (ind indicator.CommonIndicator)
- func (e *Engine) Balance() (balance float64)
- func (e *Engine) CancelAllOrder()
- func (e *Engine) CloseLong(price, amount float64)
- func (e *Engine) CloseShort(price, amount float64)
- func (e *Engine) Log(v ...interface{})
- func (e *Engine) Merge(src, dst string, fn common.CandleFn)
- func (e *Engine) OnCandle(candle Candle)
- func (e *Engine) OpenLong(price, amount float64)
- func (e *Engine) OpenShort(price, amount float64)
- func (e *Engine) Position() (float64, float64)
- func (e *Engine) SendNotify(content, contentType string)
- func (e *Engine) SetBalance(balance float64)
- func (e *Engine) StopLong(price, amount float64)
- func (e *Engine) StopShort(price, amount float64)
- func (e *Engine) UpdateBalance(balance float64)
- func (e *Engine) UpdatePosition(pos, price float64)
- func (e *Engine) Watch(watchType string)
- type KlinePlugin
- type NewRunnerFn
- type Runner
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 (*Engine) AddIndicator ¶
func (e *Engine) AddIndicator(name string, params ...int) (ind indicator.CommonIndicator)
func (*Engine) CancelAllOrder ¶
func (e *Engine) CancelAllOrder()
func (*Engine) CloseShort ¶
func (*Engine) SendNotify ¶
func (*Engine) SetBalance ¶
func (*Engine) UpdateBalance ¶
func (*Engine) UpdatePosition ¶
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 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
}
Click to show internal directories.
Click to hide internal directories.