-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathohlcv.go
More file actions
44 lines (37 loc) · 805 Bytes
/
ohlcv.go
File metadata and controls
44 lines (37 loc) · 805 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package ticker
import (
"log"
"time"
"github.com/rs/xid"
)
//TODO
// time: minuten den börjar räkna från
// open: första pris
// high: max
// low: min
// close: sista pris
// volume: sista dayVolume - första dayVolume
type Ohlcv struct {
Id xid.ID
Open float64
High float64
Low float64
Close float64
Volume int
Time time.Time
}
type AvanzaHistory struct {
Ohlcv []AvanzaOhlcv `json:"ohlc"`
}
type AvanzaOhlcv struct {
Timestamp int `json:"timestamp"`
Open float64 `json:"open"`
Close float64 `json:"close"`
Low float64 `json:"low"`
High float64 `json:"high"`
TotalVolumeTraded int `json:"totalVolumeTraded"`
}
func (m Ohlcv) processTick(s Store, t Tick) {
log.Println("ohlcv.go")
s.Push(t)
}