remove leeeacy binance margin stream program

This commit is contained in:
c9s 2021-01-29 11:00:21 +08:00
parent 8d777a7ea1
commit 73ba05cb3e

View File

@ -1,35 +0,0 @@
package main
import (
"context"
"os"
"syscall"
"time"
log "github.com/sirupsen/logrus"
"github.com/c9s/bbgo/pkg/cmd/cmdutil"
"github.com/c9s/bbgo/pkg/exchange/binance"
)
func main() {
log.SetLevel(log.DebugLevel)
ctx, cancel := context.WithCancel(context.Background())
// gobinance.NewClient(os.Getenv("BINANCE_API_KEY"), os.Getenv("BINANCE_API_SECRET"))
ex := binance.New(os.Getenv("BINANCE_API_KEY"), os.Getenv("BINANCE_API_SECRET"))
ex.UseMargin(true)
stream := ex.NewStream()
if err := stream.Connect(ctx); err != nil {
log.Fatal(err)
}
cmdutil.WaitForSignal(ctx, syscall.SIGINT, syscall.SIGTERM)
cancel()
time.Sleep(5 * time.Second)
return
}