-
Notifications
You must be signed in to change notification settings - Fork 125
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
"Margin is insufficient" - I have plenty of margin. #9
Comments
When I bring it down to 1x it works fine.. Thanks! |
Looks like trades are occuring via Binance, but nothing is really being printed to console.. |
How does one follow updates in addition to all of these questions? |
And without changing anything it now does not work at all. |
In bot_function.py you need to change qty = 0.1 or something your portfolio persent. In bot_function.py change cross leverage to isolated. then in settings.json change margin type isolated. |
when I get some time i'll see if i can make this simpler. |
facing the same issue |
In my case the "Margin is insufficient." error was occurring when the bot tries to place a trailing stop loss order, following the initial long or short position. I was able to prevent this from happening by leaving some percentage of the total margin available in the wallet. Effectively, changed the calculate_position_size bot function to not use 99% of the total margin when opening the initial position. Done this by modifying line 119 in bot_functions.py: From: To: And also using ISOLATED margin_type in settings.json. |
Please help.. I have plenty of margin room.
{"code":-2019,"msg":"Margin is insufficient."} Encountered Exception ('ExecuteError', '[Executing] -2019: Margin is insufficient.') Traceback (most recent call last): File "C:\Users\mxwo\Documents\Apps\binance_futures_bot\bot.py", line 47, in <module> qty, side, in_position = bf.handle_signal(client, std, File "C:\Users\mxwo\Documents\Apps\binance_futures_bot\bot_functions.py", line 218, in handle_signal execute_order(client, _qty=qty, _side=order_side, _market=market) File "C:\Users\mxwo\Documents\Apps\binance_futures_bot\bot_functions.py", line 107, in execute_order client.post_order(symbol=_market, File "C:\Users\mxwo\Documents\Programs\lib\site-packages\binance_f\requestclient.py", line 246, in post_order response = call_sync(self.request_impl.post_order(symbol, side, ordertype, File "C:\Users\mxwo\Documents\Programs\lib\site-packages\binance_f\impl\restapiinvoker.py", line 44, in call_sync check_response(json_wrapper) File "C:\Users\mxwo\Documents\Programs\lib\site-packages\binance_f\impl\restapiinvoker.py", line 21, in check_response raise BinanceApiException(BinanceApiException.EXEC_ERROR, "[Executing] " + str(code) + ": " + msg) binance_f.exception.binanceapiexception.BinanceApiException: ('ExecuteError', '[Executing] -2019: Margin is insufficient.')
The text was updated successfully, but these errors were encountered: