Comments (4)
hi @georgk10 , could you set client.Debug = true
to print the request info?
I'm not sure the restriction of Market order, however, it would be better to ask admins in binance API telegram group about the error.
from go-binance.
Hi @adshao , here is the output generated by my bot with client.debug = true:
Binance-golang 2020/01/16 18:06:00 full url: https://api.binance.com/api/v3/order?timestamp=1579197960975&signature=acd8a5a055da0c39a4dbe18b8708594e8f7475374e7c96cecde2fb15d5dbe510, body: quantity=0.000000&side=BUY&symbol=BTCUSDT&type=MARKET
Binance-golang 2020/01/16 18:06:00 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070ee00), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"Content-Type":[]string{"application/x-www-form-urlencoded"}, "X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc42091dd50)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:53, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 full url: https://api.binance.com/api/v3/order?timestamp=1579197961000&signature=cda371064faa441b1fd16286cecce45318f0de5400bb8e88a4213ff987b63ba7, body: quantity=0.000000&side=BUY&symbol=ETHBTC&type=MARKET
Binance-golang 2020/01/16 18:06:01 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070f080), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}, "Content-Type":[]string{"application/x-www-form-urlencoded"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc4208520e0)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:52, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 full url: https://api.binance.com/api/v3/order?timestamp=1579197961025&signature=621eb739a7c76e3b4abc21af66acbbd5f2e025de8e77e67aa11fe3b8d7e2a217, body: quantity=0.000000&side=SELL&symbol=ETHUSDT&type=MARKET
Binance-golang 2020/01/16 18:06:01 request: &http.Request{Method:"POST", URL:(*url.URL)(0xc42070f500), Proto:"HTTP/1.1", ProtoMajor:1, ProtoMinor:1, Header:http.Header{"Content-Type":[]string{"application/x-www-form-urlencoded"}, "X-Mbx-Apikey":[]string{"3CKOVkhL4frCVTCeNwLpExQIRjsFQ9Ab0c4OUX59pKRqmpMTH19PsNhgCR9lzlpk"}}, Body:ioutil.nopCloser{Reader:(*bytes.Buffer)(0xc420852620)}, GetBody:(func() (io.ReadCloser, error))(0x7f9342518900), ContentLength:54, TransferEncoding:[]string(nil), Close:false, Host:"api.binance.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:(*context.emptyCtx)(0xc42000c4a0)}
Binance-golang 2020/01/16 18:06:01 response: &http.Response{Status:"400 Bad Request", StatusCode:400, Proto:"HTTP/2.0", ProtoMajor:2, ProtoMinor:0, Header:http.Header{"Date":[]string{"Thu, 16 Jan 2020 18:06:01 GMT"}, "Server":[]string{"nginx"}, "X-Mbx-Uuid":[]string{"2b5088c2-b8fc-4f76-88f2-b906c5d71414"}, "X-Cache":[]string{"Error from cloudfront"}, "Via":[]string{"1.1 5e2b2bef8be6bee05fe23de3ed9e3a6e.cloudfront.net (CloudFront)"}, "X-Amz-Cf-Id":[]string{"Q0sqHtThGAz-v_8eXU8a12w1YaWNt4leF4DWNTSi0DjSoL35Augwhw=="}, "X-Mbx-Used-Weight-1m":[]string{"6"}, "X-Content-Type-Options":[]string{"nosniff"}, "Content-Security-Policy":[]string{"default-src 'self'"}, "Pragma":[]string{"no-cache"}, "X-Amz-Cf-Pop":[]string{"DUB2-C1"}, "X-Mbx-Used-Weight":[]string{"6"}, "Strict-Transport-Security":[]string{"max-age=31536000; includeSubdomains"}, "X-Content-Security-Policy":[]string{"default-src 'self'"}, "X-Webkit-Csp":[]string{"default-src 'self'"}, "Expires":[]string{"0"}, "Content-Type":[]string{"application/json;charset=utf-8"}, "X-Frame-Options":[]string{"SAMEORIGIN"}, "X-Xss-Protection":[]string{"1; mode=block"}, "Cache-Control":[]string{"no-cache, no-store, must-revalidate"}}, Body:http.http2transportResponseBody{cs:(*http.http2clientStream)(0xc4203d6140)}, ContentLength:-1, TransferEncoding:[]string(nil), Close:false, Uncompressed:false, Trailer:http.Header(nil), Request:(*http.Request)(0xc4200ec400), TLS:(*tls.ConnectionState)(0xc4203cc790)}
Binance-golang 2020/01/16 18:06:01 response body: {"code":-1106,"msg":"Parameter 'quantity' sent when not required."}
Binance-golang 2020/01/16 18:06:01 response status code: 400
code=-1106, msg=Parameter 'quantity' sent when not required.
from go-binance.
Problem solved, the log showed that quantity was set to 0 due to an calculation problem. Everything works fine now. Thanks for the hint with setting client.debug = true
from go-binance.
Problem solved, the log showed that quantity was set to 0 due to an calculation problem. Everything works fine now. Thanks for the hint with setting client.debug = true
Glad to hear that.
from go-binance.
Related Issues (20)
- Get all SymbolTickers without providing a symbol or []symbols
- Earn and Funding endpoints not covered
- Futures Testnet - Kline not working
- "Sleep" at the first operation
- Futures Client: Constant listenKeyExpired HOT 1
- how to get permission? HOT 2
- Crypto Box? HOT 1
- <APIError> code=-1106, msg=Parameter 'reduceonly' sent when not required. HOT 1
- how to keep listenKey alive? HOT 1
- when listenKey expired get error:json: cannot unmarshal string into Go struct field WsUserDataEvent.E of type int64 HOT 2
- can not get balance
- unexpected end of JSON input
- is threre subToMaster or masterToSub method?
- is there demo code to use subtoSub?
- something wrong happened when I get account asset? HOT 3
- [feat] support biance non-global HOT 2
- Support Query Margin Available Inventory
- Please do a new release HOT 10
- How to get x-mbx-used-weight-1m? HOT 2
- binance.WebsocketTimeout = time.Second * 5 Not working !
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-binance.