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

Hi question not issue. #18

Closed
colingresty opened this issue Jan 23, 2018 · 7 comments
Closed

Hi question not issue. #18

colingresty opened this issue Jan 23, 2018 · 7 comments

Comments

@colingresty
Copy link

Hi is there a LOT_SIZE calculator method in Binance.net?

@JKorf
Copy link
Owner

JKorf commented Jan 23, 2018

Hi, currently there is not. What would you expect if this?

@colingresty
Copy link
Author

Hi, well when i send a quantity in a buy order, the quantity has to meet the LOT_SIZE filter on binance, or i get the following error, -1013 "Filter failure: LOT_SIZE"
unless i am wrong , the quantity has to meet the requirements below.
I think other versions of this type of library (ccxt for example) have a function to convert your quantity to one that is divisible by "stepSize" .

This is from the Binance API documentation:

LOT_SIZE
The LOT_SIZE filter defines the quantity (aka "lots" in auction terms) rules for a symbol. There are 3 parts:

minQty defines the minimum quantity/icebergQty allowed.
maxQty defines the maximum quantity/icebergQty allowed.
stepSize defines the intervals that a quantity/icebergQty can be increased/decreased by.

In order to pass the lot size, the following must be true for quantity/icebergQty:
quantity >= minQty
quantity <= maxQty
(quantity-minQty) % stepSize == 0
/exchangeInfo format:

{
"filterType": "LOT_SIZE",
"minQty": "0.00100000",
"maxQty": "100000.00000000",
"stepSize": "0.00100000"
}

@JKorf
Copy link
Owner

JKorf commented Jan 24, 2018

I could add toggle-able functionality like this, where the library automatically complies to the ExchangeInfo filter rules, and return an error or auto adjust the parameters to comply. Would that be helpful to you?

@colingresty
Copy link
Author

colingresty commented Jan 24, 2018 via email

@JKorf
Copy link
Owner

JKorf commented Jan 24, 2018

Hi, I've just pushed a new version in which BinanceClient contains a TradeRulesBehaviour. Setting this to ThrowError will return an error if the order doesn't comply. Setting it to AutoComply automatically complies the parameters to the rules (min/max price and quantity, and the step/tick sizes).

For manual usage there are also Clamp functions in the BinanceHelpers class which you can use to comply to the trading rules.

@JKorf JKorf closed this as completed Jan 24, 2018
@colingresty
Copy link
Author

colingresty commented Jan 24, 2018 via email

@JKorf
Copy link
Owner

JKorf commented Jan 24, 2018

After having to google what Patreon was, I´ve come to the conclusion that sadly I do not

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