Skip to content
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

seeing errors in ADA/USDT pair again. #422

Open
zlly20 opened this issue Nov 1, 2023 · 3 comments
Open

seeing errors in ADA/USDT pair again. #422

zlly20 opened this issue Nov 1, 2023 · 3 comments

Comments

@zlly20
Copy link

zlly20 commented Nov 1, 2023

I'm on PassivBot version v6.0.0.

ADAUSDT pair was running on OKX demo account, sometimes I see this errors.

error executing order None [{'side': 'buy', 'position_side': 'long', 'qty': 11780.0, 'price': 0.2896, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}, {'side': 'sell', 'position_side': 'short', 'qty': 2796.0, 'price': 0.2942, 'type': 'limit', 'reduce_only': False, 'custom_id': 'short_ientry_normal'}] okx {"code":"1","data":[{"clOrdId":"0fe0667832d7BCDElngretr9a6ffeb3b","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDEshrtietrnrml1bcb","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"}],"inTime":"1698809856288092","msg":"All operations failed","outTime":"1698809856289029"}
returned: None
error executing order None [{'side': 'sell', 'position_side': 'long', 'qty': 1673.0, 'price': 0.2904, 'type': 'limit', 'reduce_only': True, 'custom_id': 'long_nclose'}, {'side': 'buy', 'position_side': 'long', 'qty': 3422.0, 'price': 0.2846, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}, {'side': 'buy', 'position_side': 'long', 'qty': 11903.0, 'price': 0.281, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}] okx {"code":"2","data":[{"clOrdId":"0fe0667832d7BCDElngnclseeb6bef40","ordId":"639791145693843456","sCode":"0","sMsg":"Order placed","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretr855996584","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretrf683e97e2","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"}],"inTime":"1698810095877910","msg":"Bulk operation partially successful","outTime":"1698810095879954"}
returned: None
error executing order None [{'side': 'buy', 'position_side': 'long', 'qty': 3422.0, 'price': 0.2846, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}, {'side': 'buy', 'position_side': 'long', 'qty': 11903.0, 'price': 0.281, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}] okx {"code":"1","data":[{"clOrdId":"0fe0667832d7BCDElngretr27c3fc1eb","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretr03135e6e0","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"}],"inTime":"1698810156079173","msg":"All operations failed","outTime":"1698810156079983"}
returned: None
error executing order None [{'side': 'sell', 'position_side': 'long', 'qty': 1673.0, 'price': 0.2904, 'type': 'limit', 'reduce_only': True, 'custom_id': 'long_nclose'}, {'side': 'buy', 'position_side': 'long', 'qty': 3422.0, 'price': 0.2846, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}, {'side': 'buy', 'position_side': 'long', 'qty': 11903.0, 'price': 0.281, 'type': 'limit', 'reduce_only': False, 'custom_id': 'long_rentry'}] okx {"code":"2","data":[{"clOrdId":"0fe0667832d7BCDElngnclsbacf6c46e","ordId":"639792909834883072","sCode":"0","sMsg":"Order placed","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretreb2e7d4f1","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretr21ce0a306","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"}],"inTime":"1698810516482365","msg":"Bulk operation partially successful","outTime":"1698810516484358"}
returned: None
Traceback (most recent call last):
File "/home/gary/passivbot-test/tradingbot-passivbot/exchanges/okx.py", line 220, in execute_orders
executed = await self.okx.private_post_trade_batch_orders(params=to_execute)
File "/home/gary/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ccxt/async_support/base/exchange.py", line 1889, in request
return await self.fetch2(path, api, method, params, headers, body, config)
File "/home/gary/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ccxt/async_support/base/exchange.py", line 1886, in fetch2
return await self.fetch(request['url'], request['method'], request['headers'], request['body'])
File "/home/gary/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ccxt/async_support/base/exchange.py", line 221, in fetch
self.handle_errors(http_status_code, http_status_text, url, method, headers, http_response, json_response, request_headers, request_body)
File "/home/gary/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ccxt/async_support/okx.py", line 6457, in handle_errors
self.throw_exactly_matched_exception(self.exceptions['exact'], errorCode, feedback)
File "/home/gary/.pyenv/versions/3.9.6/lib/python3.9/site-packages/ccxt/async_support/base/exchange.py", line 2252, in throw_exactly_matched_exception
raise exactstring
ccxt.base.errors.InvalidOrder: okx {"code":"1","data":[{"clOrdId":"0fe0667832d7BCDElngretr28ede9c67","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"},{"clOrdId":"0fe0667832d7BCDElngretr4c4536856","ordId":"","sCode":"51004","sMsg":"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again. ","tag":"0fe0667832d7BCDE"}],"inTime":"1698810575656412","msg":"All operations failed","outTime":"1698810575657277"}

this is my config used.

{"config_name": "recursive_grid_0days", "logging_level": 0, "long": {"auto_unstuck_ema_dist": 0.002601700060261469, "auto_unstuck_wallet_exposure_threshold": 0.032509324676618115, "backwards_tp": true, "ddown_factor": 0.15572875676464792, "ema_span_0": 70.75996248512197, "ema_span_1": 23.91241370477809, "enabled": true, "initial_eprice_ema_dist": 0.004, "initial_qty_pct": 0.0405223264238860, "markup_range": 0.00017965908207479874, "min_markup": 0.002360185662105618, "n_close_orders": 11, "rentry_pprice_dist": 0.00904732184901534, "rentry_pprice_dist_wallet_exposure_weighting": 0.8371479219320042, "wallet_exposure_limit": 1.0}, "short": {"auto_unstuck_ema_dist": 0.001285821081827295, "auto_unstuck_wallet_exposure_threshold": 0.040046424076117346, "backwards_tp": true, "ddown_factor": 1.5577915980755666, "ema_span_0": 999.7047405995305, "ema_span_1": 357.1896150576582, "enabled": true, "initial_eprice_ema_dist": -0.010743564169045993, "initial_qty_pct": 0.0459246467580464, "markup_range": 0.0013080609244183166, "min_markup": 0.003199240995036451, "n_close_orders": 14, "rentry_pprice_dist": 0.025166703612064797, "rentry_pprice_dist_wallet_exposure_weighting": 2.5872130117358685, "wallet_exposure_limit": 1.0}}

any pointers on why this is happening would be good.

@enarjord
Copy link
Owner

enarjord commented Nov 1, 2023

The error message there is:
"After placing order, your position will exceed the maximum position size limit. Lower the leverage and place order again."

Leverage can be set when starting the bot with kwarg -lev x. Some exchanges require closing all open orders and/or positions before a leverage change.

@zlly20
Copy link
Author

zlly20 commented Nov 6, 2023

thanks, i think we can close this.

@zlly20
Copy link
Author

zlly20 commented Nov 6, 2023

closing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants