Comments (12)
This is not the place to be asking this kind of question. These issues are for problems with the library or potential enhancements to it, not a support line for javascript or the binance API.
However, without someone knowing more specifics about your question it's going to be hard to answer it as is. What's the specific error you're getting, and what's your current code look like? What have you tried that's not working and how have you tried to troubleshoot it? You should try looking through the official docs for answers, or maybe try searching through or asking a question on stackoverflow. Maybe this is what you're looking for https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round?
from binance.
I've decided I'm going to repurpose your issue and use it to track an enhancement to the library. That is, adding examples for each library method. It would be nice if each example could also be run individually for testing various routes during development.
from binance.
Thanks, sorry for the question. Anyway i managed to solve it by copying zenbot's solution.
function roundToNearest(numToRound) {
let numToRoundTo = minQty // value from the exchange filters
numToRoundTo = 1 / (numToRoundTo)
return Math.floor(numToRound * numToRoundTo) / numToRoundTo
}
from binance.
@talvasconcelos Would you mind sharing the rest of your code? Perhaps I could use it as an example for others
from binance.
@aarongarvey i can give some help with that if you need. I'm building (or at least trying) a scanner for Binance.
Edit: oops you're too fast... i don't haven't on git yet, as i'm doing a trader to go with it also... but i can share a gist with some methods i've used so far. Is that ok? Can i post them in raw and you edit to your liking?
from binance.
Works for me, and thanks!
from binance.
@aarongarvey here's a small gist with some examples... it's a bit messy, if you have any troubles please contact me. But i guess you can easilly adapt from there.
https://gist.github.com/talvasconcelos/4fdb25f51ea34ad457ddcbb60156b330
from binance.
Had to add this for MIN_NOTONIAL filter for orders to go through:
function getOrderMinSize(currency) {
if (currency === 'BTC') return 0.002
else if (currency === 'ETH') return 0.02
else return 1
}
Hope this can help you @aarongarvey if you need i can make some dummy examples!
from binance.
Thanks for the code. I think I've decided on what is probably the best way to approach this, and that's an examples directory with individual files that each show a common task or route, and even better if the file is executable on it's own. If you've got the time and wanna create some, by all means, go for it.
from binance.
Somewhat on topic -- I've written a function in my own project that processes the lot size, min notional, and step size filters and returns a modified quantity and price which should fit within the filter requirements. I'm thinking of porting it into my fork of this binance repository. Since everyone who does some math on quantities and prices is going to have to do this work, I think it would be appropriate to have something inside of this package.
from binance.
Example: apexearth@59d7fe5
from binance.
@apexearth Took a quick look at the code and it looks great. I think having an example in the readme would be good as well. Then if you wanna create a pull request, go for it and I'll merge it back into master.
from binance.
Related Issues (20)
- Some Events are not firing HOT 2
- misleading name for `force` parameter of `closeAll()` method
- [question] How to return the data received by websocket to the front-end project HOT 1
- missing changelog HOT 5
- Unecesarry ping when WebSocket is not ready
- Add missing simple-earn endpoints HOT 1
- Missing API endpoint for Query Commission Rates (USER_DATA) HOT 2
- run example ws-public-spot-orderbook.ts failed HOT 9
- Nextjs - can't resolve 'socks-proxy-agent' HOT 3
- getting "Unknown order sent" error every time I call cancelOrder HOT 4
- kucoin-api-node HOT 3
- Incorrect Type Definition for WsMessage24hrTickerFormatted HOT 2
- TypeError: Cannot create property 'newClientOrderId' on string 'BTCUSDT' HOT 1
- input params for subscribeDiffBookDepth() are not right HOT 5
- browser ping issue HOT 4
- Binance could not find order during closing request, but executed it 4 hours later HOT 4
- Error: read ECONNRESET HOT 3
- Custom URL or Endpoint HOT 5
- Request: REST Endpoints for SOR Trades HOT 1
- Cannot connect/subscribe to SpotUserDataStream on Testnet
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 binance.