-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Unable to exit trade [pair here], kucoin Order size exceeded the limit #7924
Comments
at first glance - the strategy did scale in - why not scale out? If you're not allowed to exit a trade in one go - then this will mess up the whole risk management completely. It'll mean that a stoploss is effectively meaningless - if we need to retry exiting over and over until it works, price could've dropped from the intended 10% stoploss to 50% loss or more (especially considering that such orders may or may not fill, depending on their size) - and this is a problem you'll almost exclusively encounter on shit-coin markets. The right approach in my opinion is therefore be to reject further DCA entries if the maximum has been reached. based on the numbers, the maximum exit allowed at once is around ~2500$ (10_000_000_000 SOS) for this pair (a little less depending on price) - so i think we would have the correct numbers available (unless you tell me the actual numbers were different / a lot lower) - they're just not checked when doing further entries. |
at first glance - the strategy did scale in - why not scale out? If you're not allowed to exit a trade in one go - then this will mess up the whole risk management completely. based on the numbers, the maximum exit allowed at once is around ~2500$ (10_000_000_000 SOS) for this pair (a little less depending on price) The right approach in my opinion is therefore be to reject further DCA entries if the maximum has been reached. Imagine a world in that SOS drops to 10% once again and kucoin does not react rising their transaction limits. edit: why not exit order pyramiding? i.e. shoving multiple exit orders down the exchanges' throat at the same time |
If we're realistic - then the only reliable information we get from the exchange is "can't create order" (not why). The reason is nested in text / response (which can change with API updates, and will be different by exchange). this makes your proposed solution near impossible to maintain reliably - and even if we'd be going down that route - it'd be for supported exchanges with reliable API's - which Kucoin is (as sorry as i am about this) not one of (due to their api instability). On top of that, we're currently only keeping track of 1 order (and an additional stoploss order). Please provide me with the full exception logs (before the above method there should be stacktraces - or at least other errors / messages which identify where the error actually came from (this will not be the only/first message about this). |
the same is true in the opposite direction - if you're on a low end trade (15$ or so) - and the minimum limit get's raised as the coin had a huge run - then it's the same exact situation - and can't (automatically) sell the position anymore. limit changes is something that's out of our control - and we don't WANT to make the decision for the user to "buy more to sell all" - as depending on the market conditions - this can lead to unexpected losses (the same is true in your sample, just in the other direction). You can also still get out of such a position by manually selling parts of the trade first - but it's not something that can be relied on automatically - as it may or may not reflect the actual user desire (which will be different based on the situation - you'll want to scale out as you're in profit - but the next trade is at a loss - though you belive it to recover so don't want to get out). |
well just gonna filter out low $ value coins per pair for that reason then, sadge... and btw by sequential I did not mean "fire one for half the volume and then let the bot decide after it s done" but to remember the n'th task you have to exit again. That all assumed that your statement of the "volume to big" would be something you could go by and rely on. |
Well nothing in this regards will change the fact that you have an order that's > the allowed size. this means in case of a "must" exit (stoploss) - you cannot get out fast (you need to do multiple orders). as said above - even IF we were supporting that (irrelevant if easy/simple to do or not) - it'd make stoploss meaningless - as you could exit at -10% for the first order, and seconds later at -20% with the 2nd order (these are low value coins - so they tend to do huge moves). |
Describe your environment
Docker, 2022.11
Describe the problem:
Kucoin only accepts a certain value for its' orders and blocks everything that is above that arbitrary order volume limit.
Steps to reproduce:
Observed Results:
the bot bought deep into its' DCA stack and had a "relatively" giant order (nothing outworldly, seriously...) but kucoin still denied the exit order. as seen in the provided logs.
if the exchange does not allow a big order in one piece, make smaller chunks (so the error does not deny the order anymore).
Solution1:
Do n parallel exit orders, lower the order size incrementally until one order works. Then repeat until all money is caught up in a limit or market order. (we already can do partial exits so this "might" be possible?)
Solution2:
Put up a smaller exit order that does not error out and then instantly fire the next one if this is no partial exit originally.
Relevant code exceptions or logs
These lines repeat over and over:
2022-12-20 21:23:26 - freqtrade.freqtradebot - WARNING - Unable to exit trade SOS/USDT: Could not place sell order due to BadRequest. Message: kucoin Order size exceeded the limit.
2022-12-20 21:23:29 - freqtrade.freqtradebot - INFO - Exit for SOS/USDT detected. Reason: roi
2022-12-20 21:23:29 - freqtrade.wallets - INFO - Wallets synced.
The text was updated successfully, but these errors were encountered: