CyberPunkMetalHead / gateio-crypto-trading-bot-binance-announcements-new-coins

This is a crypto trading bot that scans the Binance Annoucements page for new coins, and places trades on Gateio
MIT License
1.21k stars 303 forks source link

Wrong amount on sell #55

Closed kekkokk closed 2 years ago

kekkokk commented 2 years ago

https://github.com/CyberPunkMetalHead/gateio-crypto-trading-bot-binance-announcements-new-coins/blob/50537b9266c0da429410ab1b39cee323922a7919/trade_client.py#L39

this can work for a buy order, but dividing the amount by the price while selling is wrong (If I understood correctly?)

example error code on sell: {"label":"INVALID_PARAM_VALUE","message":"Your order size 0.00799004248012527 is too small. The minimum is 1 USDT"}

busyuqboy commented 2 years ago

I think the error is obvious here. You can't sell less than 1 USDT equivalent amount of any pairing. This isn't a math problem caclulating the sell order amount. You hit a prevention/requirement.

kekkokk commented 2 years ago

when the bot tries to sell, it passes to this function the amount he wants to sell (95.5% of the total owned amount) and the price it want to sell.

but this function sets the amount/price so you are selling a fraction of what you really want to sell. Am I right?

kekkokk commented 2 years ago

sorry, the misunderstanding is due to a poor merge revision of this branch in my own fork

https://github.com/CyberPunkMetalHead/gateio-crypto-trading-bot-binance-announcements-new-coins/pull/18/files#diff-b10564ab7d2c520cdd0243874879fb0a782862c3c902ab535faabe57d5a505e1R124