Documentation
¶
Index ¶
- Constants
- Variables
- func CoinConfig(coins map[model.Coin]mlmodel.ConfigSegment) *mlmodel.Config
- func Config(coin ...model.Coin) *mlmodel.Config
- func ConfigKey(coin model.Coin, d int) model.Key
- func DeprecatedProcessor(index api.Index, shard storage.Shard, registry storage.EventRegistry, ...) func(u api.User, e api.Exchange) api.Processor
- func ForCoin(coin model.Coin, live bool) func(sgm mlmodel.SegmentConfig) mlmodel.SegmentConfig
- func ModelConfig(precision float64) mlmodel.Model
- func Processor(index api.Index, shard storage.Shard, strategy *processor.Strategy) func(u api.User, e api.Exchange) api.Processor
- func ReProcessor() (proc api.Processor, err error)
- func TraderConfig(live bool) mlmodel.Trader
- func WithConfig(coin map[model.Coin]bool) *mlmodel.Config
- type Collect
- type Collector
- type Performance
- type Tracker
Constants ¶
View Source
const (
DeprecatedName = "ml-network"
)
View Source
const (
Name = "ml-network"
)
Variables ¶
View Source
var SplitOnTrend = func(gap float64) Collect { threshold := gap return func(trade *model.TradeSignal) []float64 { trend := trade.Tick.StatsData.Trend.Price / trade.Tick.Price y := make([]float64, 3) if trend > threshold { y[0] = 1 } else if trend < -1*threshold { y[2] = 1 } else { y[1] = 1 } return y } }
Functions ¶
func CoinConfig ¶
func DeprecatedProcessor ¶
func DeprecatedProcessor(index api.Index, shard storage.Shard, registry storage.EventRegistry, config *mlmodel.Config, networks ...net.ConstructNetwork) func(u api.User, e api.Exchange) api.Processor
Processor is the position processor main routine.
func ForCoin ¶
func ForCoin(coin model.Coin, live bool) func(sgm mlmodel.SegmentConfig) mlmodel.SegmentConfig
func ModelConfig ¶
func Processor ¶
func Processor(index api.Index, shard storage.Shard, strategy *processor.Strategy) func(u api.User, e api.Exchange) api.Processor
Processor is the position processor main routine.
func ReProcessor ¶
func TraderConfig ¶
Types ¶
type Collect ¶
type Collect func(trade *model.TradeSignal) []float64
var CollectStats Collect = func(trade *model.TradeSignal) []float64 { trend := 100 * trade.Tick.StatsData.Trend.Price / trade.Tick.Price std := trade.Tick.StatsData.Std.Price / trade.Tick.Price volume := trade.Tick.StatsData.Std.Volume / trade.Tick.Volume size := float64(trade.Meta.Size) buyEvents := trade.Tick.StatsData.Buy.Count / size sellEvents := trade.Tick.StatsData.Sell.Count / size buyVolume := trade.Tick.StatsData.Buy.Volume / trade.Tick.Volume sellVolume := trade.Tick.StatsData.Sell.Volume / trade.Tick.Volume return []float64{trend, std, volume, buyVolume, buyEvents, sellVolume, sellEvents, size, trade.Tick.Price} }
var Trend Collect = func(trade *model.TradeSignal) []float64 { trend := 100 * trade.Tick.StatsData.Trend.Price / trade.Tick.Price return []float64{trend, trade.Tick.Price} }
type Collector ¶
type Collector struct {
// contains filtered or unexported fields
}
Collector collects trade stats based on the collector functions it groups previous trade stats, so we can join the previous and next stats and can effectively train a model
type Performance ¶
type Performance struct {
// contains filtered or unexported fields
}
func (Performance) String ¶
func (p Performance) String() string
func (Performance) Value ¶
func (p Performance) Value(lazy bool) float64
type Tracker ¶
type Tracker struct { Buffer *buffer.MultiBuffer Performance map[mlmodel.Detail]Performance Prediction map[mlmodel.Detail][][]float64 }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.