Documentation ¶
Index ¶
- 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) CancelOrder(id string)
- func (e *EngineImpl) CloseLong(price, amount float64) string
- func (e *EngineImpl) CloseShort(price, amount float64) string
- func (e *EngineImpl) DoOrder(typ TradeType, price, amount float64) string
- func (e *EngineImpl) Log(v ...interface{})
- func (e *EngineImpl) Merge(vmID, src, dst string, fn common.CandleFn)
- func (e *EngineImpl) OnCandle(candle *Candle)
- func (e *EngineImpl) OpenLong(price, amount float64) string
- func (e *EngineImpl) OpenShort(price, amount float64) string
- func (e *EngineImpl) Position() (float64, float64)
- func (e *EngineImpl) RemoveMerge(vmID string)
- func (e *EngineImpl) SendNotify(title, content, contentType string)
- func (e *EngineImpl) SetBalance(balance float64)
- func (e *EngineImpl) StopLong(price, amount float64) string
- func (e *EngineImpl) StopShort(price, amount float64) string
- func (e *EngineImpl) UpdateBalance(balance float64)
- func (e *EngineImpl) UpdatePosition(pos, price float64)
- func (e *EngineImpl) UpdateStatus(status int, msg string)
- func (e *EngineImpl) Watch(watchType string)
- type EngineWrapper
- type KlinePlugin
- type NewRunnerFn
- type Runner
- type UpdateStatusFn
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 NewEngineImpl ¶ added in v0.0.6
func NewEngineImpl(proc *BaseProcesser, symbol string) *EngineImpl
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) CancelOrder ¶ added in v0.0.6
func (e *EngineImpl) CancelOrder(id string)
func (*EngineImpl) CloseLong ¶ added in v0.0.2
func (e *EngineImpl) CloseLong(price, amount float64) string
func (*EngineImpl) CloseShort ¶ added in v0.0.2
func (e *EngineImpl) CloseShort(price, amount float64) string
func (*EngineImpl) DoOrder ¶ added in v0.0.6
func (e *EngineImpl) DoOrder(typ TradeType, price, amount float64) string
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(vmID, 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) string
func (*EngineImpl) OpenShort ¶ added in v0.0.2
func (e *EngineImpl) OpenShort(price, amount float64) string
func (*EngineImpl) Position ¶ added in v0.0.2
func (e *EngineImpl) Position() (float64, float64)
func (*EngineImpl) RemoveMerge ¶ added in v0.1.0
func (e *EngineImpl) RemoveMerge(vmID string)
func (*EngineImpl) SendNotify ¶ added in v0.0.2
func (e *EngineImpl) SendNotify(title, 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) string
func (*EngineImpl) StopShort ¶ added in v0.0.2
func (e *EngineImpl) StopShort(price, amount float64) string
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) UpdateStatus ¶ added in v0.0.6
func (e *EngineImpl) UpdateStatus(status int, msg string)
func (*EngineImpl) Watch ¶ added in v0.0.2
func (e *EngineImpl) Watch(watchType string)
type EngineWrapper ¶ added in v0.0.6
type EngineWrapper struct { *EngineImpl VmID string Cb UpdateStatusFn }
func NewEngineWrapper ¶ added in v0.0.6
func NewEngineWrapper(proc *BaseProcesser, cb UpdateStatusFn, symbol string, id string) *EngineWrapper
func (*EngineWrapper) CleanMerges ¶ added in v0.1.0
func (e *EngineWrapper) CleanMerges()
func (*EngineWrapper) Merge ¶ added in v0.1.0
func (e *EngineWrapper) Merge(src, dst string, fn common.CandleFn)
func (*EngineWrapper) UpdateStatus ¶ added in v0.0.6
func (e *EngineWrapper) UpdateStatus(status int, msg 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 }
type UpdateStatusFn ¶ added in v0.0.6
Click to show internal directories.
Click to hide internal directories.