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