Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make market trades #32

Open
joshua-cooper opened this issue May 27, 2018 · 2 comments
Open

Cannot make market trades #32

joshua-cooper opened this issue May 27, 2018 · 2 comments

Comments

@joshua-cooper
Copy link

joshua-cooper commented May 27, 2018

I get an error when I try to make a market trade using the example,

long recvWindow = 10000;
Json::Value result;
BinaCPP::send_order( "BNBETH", "BUY", "MARKET", "GTC", 20 , 0,   "",0,0, recvWindow, result );

The output of result is:

"code" : -1106,
"msg" : "Parameter 'timeInForce' sent when not required."

I have tried to change the timeInForce to each available one but it doesn't work. If I remove it completely, I get this error:

"code" : -1105,
"msg" : "Parameter 'timeInForce' was was empty."

I have managed to make limit orders but have yet been able to make a market order. Any idea what is wrong?

As a side note, is it possible to make orders using 100% of the available asset?

@AlconDivino
Copy link

i don't know this error, but when sending a market order i get error -1021: Timestamp for this request is outside of the revWindow

Any idea?

@AlconDivino
Copy link

In binacpp.cpp i copied the send_order() function and called it send_order_market().

i commented out the time in force code:

post_data.append("&timeinforce=");
post_data.append(timeinforce);

did the same for price .

Worked out for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants