daroczig / binancer

An R client to the Public Rest API for Binance.
https://daroczig.github.io/binancer
53 stars 57 forks source link

Error in New Order Request #16

Closed untdacca closed 2 years ago

untdacca commented 3 years ago

I found an issue with placing orders using the "new order" function.

Line 723 of "binancer/R/binance.R" reads the following:

work around the limitation of %% (e.g. 200.1 %% 0.1 = 0.1 !!)

quot <- (quantity - filters[filterType == 'LOT_SIZE', minQty]) / filters[filterType == 'LOT_SIZE', stepSize]
stopifnot(abs(quot - round(quot)) < 1e-10)

Filters, is a data table specifying some of the order limits (ie max price, max quantity, etc). Filters are specific to each coin. Using the example of "BTCUSDT", the filters value for

filters[filterType == 'LOT_SIZE', stepSize] is 0. When you evaluate quot, it yields quot = x / 0.

With that, it is not possible to successfully evaluate 'abs(quot - round(quot)) < 1e-10'.

Is there any workaround to this issue?

Much appreciated!

jgroves10 commented 3 years ago

Hi,

Did you manage to find a workaround for this?

I'm having the same issues myself.

Thanks

PatronMaster commented 3 years ago

Hi Jgroves10,

I am using a very old version of this package and still work. image

A soon I have time I will make a fork with my current version. I think this team is not working on this project.

jgroves10 commented 3 years ago

Hi PatronMaster,

Thank you for the reply! I've realised the issue was being caused by me using the testnet API, which has different step sizes than that of the real mode for some pairs.

The old package is really good too! I look forward to using your current version when released.

Thanks

timothyjgraham commented 3 years ago

Hi Jgroves10,

I am using a very old version of this package and still work. image

A soon I have time I will make a fork with my current version. I think this team is not working on this project.

Hi @PatronMaster , I am wondering if you might be able to share your updated repository to fix this issue? Thank you!

daroczig commented 2 years ago

Closing as seems to be a duplicate of #14