-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.go
51 lines (45 loc) · 940 Bytes
/
main.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
/* ------------ License ------------ */
// BSD 3-Clause License
//
// Copyright (c) 2021, Seongmin Kim
// All rights reserved.
/* --------------------------------- */
package main
import (
"github.com/shieldnet/gobit-sample/strategy"
"github.com/shieldnet/gobit/jwtmaker"
"sync"
)
const (
Tfuel = "KRW-TFUEL"
)
func main() {
coinList := []string{Tfuel}
var strategies []*strategy.Strategy
key := jwtmaker.Keys{
Access: "my_access_key",
Secret: []byte("my_secret_key"),
}
for _, coin := range coinList {
s := &strategy.Strategy{
Market: coin,
BuyCandleNum: 5,
SellCandleNum: 5,
QuitRate: 2.0,
CandleUnit: 5,
NextState: "Init",
Balance: "0",
TotalPrice: "50000",
Key: key,
}
strategies = append(strategies, s)
}
for true {
wait := new(sync.WaitGroup)
wait.Add(len(strategies))
for _, s := range strategies {
go s.Execute(wait)
}
wait.Wait()
}
}