package sentio import ( "cmp" "time" ) type Strategy interface { Name() string Model() string MarketId() string PositionSymbols() map[Side]string Interval() uint8 Cooldown(periods uint8) time.Duration Handle(market Market, ts time.Time, proba float64) ([]StrategyOrder, error) } type StrategyOrder struct { Symbol string `yaml:"symbol"` Action OrderAction `yaml:"action"` Size float64 `yaml:"size"` } func CompareStrategyOrders(a, b StrategyOrder) int { if a.Action == b.Action { return cmp.Compare(b.Size, a.Size) } if OrderSell == a.Action { return -1 } return 1 }