mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
add max-orders example
This commit is contained in:
parent
f9a3863a95
commit
7cada295b8
25
examples/max-orders/main.go
Normal file
25
examples/max-orders/main.go
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"log"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
maxapi "github.com/c9s/bbgo/exchange/max/maxapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
key := os.Getenv("MAX_API_KEY")
|
||||||
|
secret := os.Getenv("MAX_API_SECRET")
|
||||||
|
|
||||||
|
maxRest := maxapi.NewRestClient(maxapi.ProductionAPIURL)
|
||||||
|
maxRest.Auth(key, secret)
|
||||||
|
|
||||||
|
orders, err := maxRest.OrderService.All("maxusdt", 100, 1, maxapi.OrderStateDone)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
for _, order := range orders {
|
||||||
|
log.Printf("%+v", order)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user