jaggedsoft / node-binance-api

Node Binance API is an asynchronous node.js library for the Binance API designed to be easy to use.
MIT License
1.58k stars 768 forks source link

Percent Changes: Make market price change percent print with no decimals #747

Open IceWinterBot506 opened 3 years ago

IceWinterBot506 commented 3 years ago

01

We currently doing config to the bot we made, we currently coded take profit percent in the bot and in the config (assuming 0.1 is 10% and 1.0 is 100% as take profit), but it doesn't work due to the decimals value of the market price percent changes and all coins has different decimals value when talking about percent changes. (See reference in the picture)

It's hard to take profit or stop loss when the percent changes of the coin got some long or weird decimals placing. I hope there will be a workaround to make the percent changes only print no decimals (eg. 20% 37% 96% not 12.2445% or 0.1875%).

IceWinterBot506 commented 3 years ago

1

More reference in the picture. Weird triple decimal in percent

IceWinterBot506 commented 3 years ago

https://github.com/jaggedsoft/node-binance-api/blob/0d0a4cd91f7698efbd4d896a323209ca6706b944/node-binance-api.js#L2651

https://github.com/jaggedsoft/node-binance-api/blob/0d0a4cd91f7698efbd4d896a323209ca6706b944/node-binance-api.js#L2652

I suppose this line of code should be the workaround?

Best regards, IceWinterBot506