portfolio_record.go 247 B

1234567891011121314151617
  1. package sentio
  2. import (
  3. "cmp"
  4. "time"
  5. )
  6. type PortfolioRecord struct {
  7. TS time.Time
  8. Equity float64
  9. PnL float64
  10. PnLPct float64
  11. }
  12. func ComparePortfolioRecords(a, b PortfolioRecord) int {
  13. return cmp.Compare(a.TS.Unix(), b.TS.Unix())
  14. }