forked from c9s/bbgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
42 lines (33 loc) · 914 Bytes
/
types.go
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
package bitgetapi
type SideType string
const (
SideTypeBuy SideType = "buy"
SideTypeSell SideType = "sell"
)
type OrderType string
const (
OrderTypeLimit OrderType = "limit"
OrderTypeMarket OrderType = "market"
)
type OrderForce string
const (
OrderForceGTC OrderForce = "gtc"
OrderForcePostOnly OrderForce = "post_only"
OrderForceFOK OrderForce = "fok"
OrderForceIOC OrderForce = "ioc"
)
type OrderStatus string
const (
OrderStatusInit OrderStatus = "init"
OrderStatusNew OrderStatus = "new"
OrderStatusLive OrderStatus = "live"
OrderStatusPartialFilled OrderStatus = "partially_filled"
OrderStatusFilled OrderStatus = "filled"
OrderStatusCancelled OrderStatus = "cancelled"
)
func (o OrderStatus) IsWorking() bool {
return o == OrderStatusInit ||
o == OrderStatusNew ||
o == OrderStatusLive ||
o == OrderStatusPartialFilled
}