Documentation ¶
Index ¶
- Constants
- func Audit(name, msg string) string
- func Error(name string, err error) string
- func History(name string, coin model.Coin, dir string) api.Processor
- func NewStateKey(processor string, key model.Key) storage.Key
- func NoProcess(name string) api.Processor
- func Process(name string, p func(trade *model.TradeSignal) error) api.Processor
- func ProcessBufferedWithClose(name string, duration time.Duration, live bool, ...) api.Processor
- func ProcessWithClose(name string, p func(trade *model.TradeSignal) error, shutdown func()) api.Processor
- func Void(name string) api.Processor
- type Enrich
- type SignalBuffer
- type Strategy
- func (s *Strategy) Config() mlmodel.Config
- func (s *Strategy) EnableML(c model.Coin, enabled bool) map[string]bool
- func (s *Strategy) EnableTrader(c model.Coin, enabled bool) map[string]bool
- func (s *Strategy) Eval(trade model.Tick, signal mlmodel.Signal, config *mlmodel.Config) (mlmodel.Signal, model.Key, bool, bool)
- func (s *Strategy) IsEnabledML(k model.Key) bool
- func (s *Strategy) IsEnabledTrader(k model.Key) bool
- func (s *Strategy) IsLive(coin model.Coin, trade model.Tick) (bool, bool)
- func (s *Strategy) Reset(key model.Key) bool
- func (s *Strategy) SetGap(coin model.Coin, gap float64) mlmodel.Config
- func (s *Strategy) SetPrecisionThreshold(coin model.Coin, network string, precision float64) mlmodel.Config
Constants ¶
View Source
const (
Name = "void"
)
Variables ¶
This section is empty.
Functions ¶
func NewStateKey ¶
NewStateKey creates a stats internal state key for the registry storage
func ProcessBufferedWithClose ¶
func ProcessBufferedWithClose(name string, duration time.Duration, live bool, p func(trade *model.TradeSignal) error, shutdown func(), enrich ...Enrich) api.Processor
ProcessBufferedWithClose is a wrapper for a processor logic with a close execution func and buffering logic.
func ProcessWithClose ¶
func ProcessWithClose(name string, p func(trade *model.TradeSignal) error, shutdown func()) api.Processor
ProcessWithClose is a wrapper for a processor logic with a close execution func.
Types ¶
type Enrich ¶
type Enrich func(trade *model.TradeSignal) *model.TradeSignal
Enrich defines a function that will enrich the trade
type SignalBuffer ¶
type SignalBuffer struct {
// contains filtered or unexported fields
}
SignalBuffer is a consistent signal source that will emit a signal each pre-specified interval.
func NewSignalBuffer ¶
func NewSignalBuffer(duration time.Duration) (*SignalBuffer, <-chan *model.TradeSignal)
NewSignalBuffer creates a new trade buffer.
func (*SignalBuffer) Close ¶
func (sb *SignalBuffer) Close()
func (*SignalBuffer) NoLive ¶
func (sb *SignalBuffer) NoLive() *SignalBuffer
func (*SignalBuffer) Push ¶
func (sb *SignalBuffer) Push(trade *model.TradeSignal)
Push adds an element ot the buffer.
func (*SignalBuffer) WithEcho ¶
func (sb *SignalBuffer) WithEcho() *SignalBuffer
type Strategy ¶
type Strategy struct {
// contains filtered or unexported fields
}
Strategy is responsible for making a call on weather the signal is good enough to trade on.
func NewStrategy ¶
func (*Strategy) EnableTrader ¶
Click to show internal directories.
Click to hide internal directories.