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