|
@@ -1,6 +1,9 @@
|
|
package sentio
|
|
package sentio
|
|
|
|
|
|
-import "time"
|
|
|
|
|
|
+import (
|
|
|
|
+ "cmp"
|
|
|
|
+ "time"
|
|
|
|
+)
|
|
|
|
|
|
type PortfolioRecord struct {
|
|
type PortfolioRecord struct {
|
|
TS time.Time
|
|
TS time.Time
|
|
@@ -8,3 +11,7 @@ type PortfolioRecord struct {
|
|
PnL float64
|
|
PnL float64
|
|
PnLPct float64
|
|
PnLPct float64
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+func ComparePortfolioRecords(a, b PortfolioRecord) int {
|
|
|
|
+ return cmp.Compare(a.TS.Unix(), b.TS.Unix())
|
|
|
|
+}
|