-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconst.go
executable file
·61 lines (51 loc) · 1.03 KB
/
const.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package goup
type TradeSide int
const (
Buy = iota
Sell
)
func (ts TradeSide) String() string {
switch ts {
case Buy:
return "buy"
case Sell:
return "sell"
default:
return "unknown"
}
}
// OrderStatus represents status of order
type OrderStatus int
const (
Submitted OrderStatus = iota
PartialFilled
Filled
Canceled
Rejected
Canceling
Expired
)
func (s OrderStatus) String() string {
status := [...]string{"Submitted", "Partial Filled", "Filled", "Canceled", "Rejected", "Canceling", "Expired"}
if s < Submitted || s > Expired {
return "Unknown"
}
return status[s]
}
// KlineInterval is the interval of k line
type KlineInterval int
const (
KlineInterval1Min KlineInterval = 1
KlineInterval5Min KlineInterval = 5
KlineInterval15Min KlineInterval = 15
KlineInterval30Min KlineInterval = 30
KlineInterval1H KlineInterval = 60
KlineInterval4H KlineInterval = 240
KlineInterval1Day KlineInterval = 1440
KlineInterval1Week
KlineInterval1Month
)
const (
Cobinhood = "cobinhood.com"
Gateio = "gate.io"
)