1234567891011121314151617181920 |
- package sentio
- import (
- "cmp"
- "time"
- )
- type Bar struct {
- Datetime time.Time `json:"datetime" yaml:"datetime"`
- Open float64 `json:"open" yaml:"open"`
- High float64 `json:"high" yaml:"high"`
- Low float64 `json:"low" yaml:"low"`
- Close float64 `json:"close" yaml:"close"`
- Volume float64 `json:"volume" yaml:"volume"`
- Trades int `json:"trades" yaml:"trades"`
- }
- func CompareBars(a, b Bar) int {
- return cmp.Compare(a.Datetime.Unix(), b.Datetime.Unix())
- }
|