bitmex-go icon indicating copy to clipboard operation
bitmex-go copied to clipboard

add test case

Open qct opened this issue 6 years ago • 5 comments

main test is too naive, add formal test case instead.

qct avatar Jan 03 '18 05:01 qct

Hello, i run with main.go tests Good Job! but please let mek now how i can start live bitmex trading or it's need build my self? please let me know

DaKoTaGeorgia avatar Apr 06 '18 13:04 DaKoTaGeorgia

@DaKoTaGeorgia No, you don't need to build yourself.

  1. go get github.com/qct/bitmex-go
  2. import this repo like main.go:
import (
    "github.com/qct/bitmex-go/restful"
    "github.com/qct/bitmex-go/swagger"
    "golang.org/x/net/context"
    "io/ioutil"
    "log"
)
  1. then you can do live bitmex trading like what did in main.go:
orderApi := restful.NewOrderApi(apiClient.OrderApi, auth)
resp, orderId, err := orderApi.LimitBuy("XBTUSD", 1.0, 13000, "qct_f_f_")

qct avatar Apr 06 '18 14:04 qct

yes sorry for noob questions but i now working with simple-bitmex-bot and now i run go on my macbook i run this code good but only test results... i mean when i will run your bot it will trading automatical with included logic or i need write logic myself ?

DaKoTaGeorgia avatar Apr 06 '18 14:04 DaKoTaGeorgia

in you code:

orderApi := restful.NewOrderApi(apiClient.OrderApi, auth) resp, orderId, err := orderApi.LimitBuy("XBTUSD", 1.0, 13000, "qct_f_f_")

bot placing 1 contract 13000$ (i mean how trade automatical...)

DaKoTaGeorgia avatar Apr 06 '18 14:04 DaKoTaGeorgia

@DaKoTaGeorgia this repo is a SDK, not a strategy, you need to write your own logic code.

qct avatar Apr 09 '18 12:04 qct