Closed Pusherman2 closed 2 months ago
Which parameters are you using to start the bot exactly? Also do you by chance have the error from the Exchange logs? I see the multibot logs you pasted above but not the exchange log errors.
Hi @donewiththedollar,
Yes that's either:
python3 multi_bot_v4.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
for multibot and the following for single:
python3 multi_bot_signalscreener_targetcoin.py
Using targetcoin I just go via GUI to specify account. Only difference in config is that for targetcoin there's a whitelisted entry. Both are run from seperate directories.
Exchange.log excerpt:
2024-07-29 19:49:44 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:47 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:49 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:51 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:53 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:55 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:56 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:49:59 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:00 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:03 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:05 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:07 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:09 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:11 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:13 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:15 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:18 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:19 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:21 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:51 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:54 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:55 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:58 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:50:59 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:01 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:03 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:05 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:07 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:09 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:10 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:12 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:14 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:16 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:18 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:19 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:22 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:24 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:26 - Exchange - INFO - Error in calculating signal: 0 2024-07-29 19:51:27 - Exchange - INFO - Error in calculating signal: 0
Hey try running
python3.11 multi_bot_aio.py --exchange bybit --account_name account_1 --strategy qsgridob --config configs/config.json
After updating your config to be sure, although if you were missing config params you'd see the error thrown in the terminal at startup.
Also run pip3.11 install -r requirements.txt
just to be sure as well
I reran pip install on all modules and fetched from scratch again and running with defaults but the same error messages are persisting.
I tried kicking up some positions to see if it picks them up and it does:
E.g. 2024-08-06 17:29:36 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:36 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:37 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:38 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:40 - Exchange - INFO - Fetched ticker for STORJUSDT: {'symbol': 'STORJ/USDT:USDT', 'timestamp': None, 'datetime': None, 'high': 0.4198, 'low': 0.3664, 'bid': 0.395, 'bidVolume': 5322.2, 'ask': 0.3952, 'askVolume': 6910.8, 'vwap': 0.39597466023267186, 'open': 0.3889, 'close': 0.3952, 'last': 0.3952, 'previousClose': None, 'change': 0.0063, 'percentage': 1.6199, 'average': 0.39205, 'baseVolume': 181367217.8, 'quoteVolume': 71816822.4457, 'info': {'symbol': 'STORJUSDT', 'lastPrice': '0.3952', 'indexPrice': '0.3960', 'markPrice': '0.3956', 'prevPrice24h': '0.3889', 'price24hPcnt': '0.016199', 'highPrice24h': '0.4198', 'lowPrice24h': '0.3664', 'prevPrice1h': '0.4047', 'openInterest': '16387166.9', 'openInterestValue': '6482763.23', 'turnover24h': '71816822.4457', 'volume24h': '181367217.8000', 'fundingRate': '0.00005455', 'nextFundingTime': '1722960000000', 'predictedDeliveryPrice': '', 'basisRate': '', 'deliveryFeeRate': '', 'deliveryTime': '0', 'ask1Size': '6910.8', 'bid1Price': '0.3950', 'ask1Price': '0.3952', 'bid1Size': '5322.2', 'basis': '', 'preOpenPrice': '', 'preQty': '', 'curPreListingPhase': ''}}
API connection to ByBit seems working. Generating new signals and processing them does not unfortunately.
Have you tried to make a new api key with the write permissions to enter trades ? Make sure that you allow taking trades in derivative. If it does not work, maybe try to get rid of the try/except statement line 340-421 to 423 and check actively what the error message is when it makes a traceback call on your terminal, that could help find where the error comes from because right now, the error is wrongly handled in the generate_l_signals function it seems like. It should not just give you 0 but it returns the "neutral" level so it won't trade and technically the bot works even if it happens, but if it does not take trades at all, then maybe that is API key problem if you've installed the bot back a few days ago
I reran pip install on all modules and fetched from scratch again and running with defaults but the same error messages are persisting.
I tried kicking up some positions to see if it picks them up and it does:
E.g.
2024-08-06 17:29:36 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:36 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:37 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:38 - Exchange - INFO - Error in calculating signal: 0 2024-08-06 17:29:40 - Exchange - INFO - Fetched ticker for STORJUSDT: {'symbol': 'STORJ/USDT:USDT', 'timestamp': None, 'datetime': None, 'high': 0.4198, 'low': 0.3664, 'bid': 0.395, 'bidVolume': 5322.2, 'ask': 0.3952, 'askVolume': 6910.8, 'vwap': 0.39597466023267186, 'open': 0.3889, 'close': 0.3952, 'last': 0.3952, 'previousClose': None, 'change': 0.0063, 'percentage': 1.6199, 'average': 0.39205, 'baseVolume': 181367217.8, 'quoteVolume': 71816822.4457, 'info': {'symbol': 'STORJUSDT', 'lastPrice': '0.3952', 'indexPrice': '0.3960', 'markPrice': '0.3956', 'prevPrice24h': '0.3889', 'price24hPcnt': '0.016199', 'highPrice24h': '0.4198', 'lowPrice24h': '0.3664', 'prevPrice1h': '0.4047', 'openInterest': '16387166.9', 'openInterestValue': '6482763.23', 'turnover24h': '71816822.4457', 'volume24h': '181367217.8000', 'fundingRate': '0.00005455', 'nextFundingTime': '1722960000000', 'predictedDeliveryPrice': '', 'basisRate': '', 'deliveryFeeRate': '', 'deliveryTime': '0', 'ask1Size': '6910.8', 'bid1Price': '0.3950', 'ask1Price': '0.3952', 'bid1Size': '5322.2', 'basis': '', 'preOpenPrice': '', 'preQty': '', 'curPreListingPhase': ''}}
API connection to ByBit seems working. Generating new signals and processing them does not unfortunately.
Like @bretzay said, see the thing is it seems like you may be having an API key issue where it actually could involve using non standard account for example but the signal is returning fine on the latest commit and I have not seen this error at all- nor has anyone else reported it so it indeed seems isolated for now which usually points to it being your API key; it is odd that the signal calculates as 0 though - the function to calculate the signal wouldn't return 0 it would return as neutral and I just did a fresh clone to be sure on the example config and everything runs smooth without error.
@bretzay, @donewiththedollar - Thank you for both insights.
I've updated with a fresh API key with correct permissions set although I would not expect the API key to be the culprit as I used it couple of days ago within my own projects as well and it was working fine.
I removed the try/except/finally blocks from the code but also no stack trace to be seen after letting it run for a while as there are no actual errors popping up.
I will do a complete new deployment to different cloud infrastructure to see if that helps and report back.
Did you resolved it? I cannot figure it out too...API is working fine with other projects.
@bretzay are you running into this issue? This is odd am not at the desk at the moment, everything has been running fine on my end one thing I can think of is to add a trace back to the generate l signals function and check the logs there it is very odd to get this error
If new deployment does not work, it's needed to do further investigation adding some log statements to check values of everything inside the said function. As of now, I'm not able to test anything on the bot as I can't trade on bybit, so I need any piece of information you can gather with log.error() and putting all the variables into it so I can see (Of preference, just after it's being initiated)
If you get nothing from adding new logging, then that would mean the ohlcv function is the problem and needs to be looked at deeper, and so yet another time to spam logging on this function to see what's going on
Sadly that's something I would usually do myself but as I can't access Bybit, I may not encounter the bug you have
Upgrading from python 3.10 to 3.11 resolved the issue for me.
Upgrading from python 3.10 to 3.11 resolved the issue for me.
YES!!! THANK YOU @rylos this gives me some feeling of sanity throughout this process! I have been away from the desk for the day and we have been trying to pinpoint what is causing this issue as I have ran my own tracebacks on local machine since this issue was brought up by @Pusherman2 and then when you had chimed in I became worried it was no where near an isolated incident and was not at the desk to even check anything.
This definitely makes sense as I have built this using Python3.11 version for a while now I'd estimate for around 6 months now or longer we have been using python3.11 - I was trying to stay "ahead of the curve" is why and I typically compile it from source along side other versions of python on the same machine.
Also, if it helps any I am using Ubuntu machines I forgot to mention that, I can see how there could be requirement issues on other machines perhaps as I myself have not tested using other distributions of Linux for example.
Hopefully everyone is able to update to python3.11 and that be the root cause of the issue at hand here; regardless I will be adding some tracebacks to functions and running a debug locally to really stress test and see if I can break things but I will say that I have been running multiple accounts from main branch using auto rotation and single symbol (target symbol mode) using the multi_bot_aio.py
(you can set target coin mode in config, and add the target coin(s) to your whitelist and then boom done it's targeted and not auto rotating).
Also, fwiw long only on target coin using 1 symbol is a really really good place to start if you want to be low risk and try to optimize your configuration setup from there (ie, raising wallet_exposure_limit_long
and understanding how the levels distribute the quantities - I think that using target coin mode really helps in not only profiting from this bot quickly, but also skipping steps on the ladder so to speak in terms of fully understanding how the bot is set up and how the current base grid strategy is working (pretty darn solid 100% win rate for over a month on longonly).
The python version in this case did not apply the me as I was already running 3.11.X. Also tried with different versions just now but it was still no dice. Also tried with latest Python version/recreating venvs en reinstalling packages but it still cause the same error.
I am still confused but I managed to get it working on a fresh cloud server deployment. Not sure what is changed as I installed everything in exactly the same way.
This issue can be closed, in case others receive this error; 1) Check Python version, upgrade/test other versions 2) Check packages/reinstall or use new venv 3) Redeploy server with fresh/blank image
@bretzay @donewiththedollar - Thanks for helping us troubleshoot.
Hi there,
Ran the bot a long time ago and wanted to run it again after updating to latest.
Pulled all changes and configured everything but i'm seeing this error in the Exchange.log repeatedly. From the dashboard it also keeps hanging after initializing.
2024-07-29 19:51:24 - MultiBot - INFO - Updated active symbols (0): set() 2024-07-29 19:51:24 - MultiBot - INFO - Updated active long symbols (0): set() 2024-07-29 19:51:24 - MultiBot - INFO - Updated active short symbols (0): set() 2024-07-29 19:51:24 - MultiBot - INFO - Updated unique active symbols (0): set() 2024-07-29 19:51:24 - MultiBot - INFO - Active symbols updated. Long symbols allowed: 10, Short symbols allowed: 10 2024-07-29 19:51:24 - MultiBot - INFO - Active symbols: set() 2024-07-29 19:51:24 - MultiBot - INFO - Unique active symbols: set() 2024-07-29 19:51:24 - MultiBot - INFO - Submitted signal processing for open position symbols: set(). 2024-07-29 19:51:24 - MultiBot - INFO - Active symbols count: 0 2024-07-29 19:51:24 - MultiBot - INFO - Unique active symbols count: 0 2024-07-29 19:51:25 - MultiBot - INFO - Updated active symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated active long symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated active short symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated unique active symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated active long symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated active short symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Updated unique active symbols (0): set() 2024-07-29 19:51:25 - MultiBot - INFO - Unique active symbols are less than allowed, scanning for new symbols 2024-07-29 19:51:25 - MultiBot - INFO - Submitted signal processing for new long rotator symbol STMXUSDT. 2024-07-29 19:51:25 - MultiBot - INFO - Using lorentzian signals 2024-07-29 19:51:25 - MultiBot - INFO - Submitted signal processing for new short rotator symbol STMXUSDT. 2024-07-29 19:51:25 - MultiBot - INFO - Processing signal for new rotator symbol STMXUSDT. Signal: neutral 2024-07-29 19:51:25 - MultiBot - INFO - Open position symbols: set() 2024-07-29 19:51:25 - MultiBot - INFO - Handling signal for new rotator symbol STMXUSDT. Current long positions: 0. Current short positions: 0. Unique active symbols: 1 2024-07-29 19:51:25 - MultiBot - INFO - New rotator symbol STMXUSDT - Has open long: False, Has open short: False 2024-07-29 19:51:25 - MultiBot - INFO - Signal: neutral, Long Mode: True, Short Mode: False 2024-07-29 19:51:25 - MultiBot - INFO - Long signal not triggered or long mode not enabled for symbol STMXUSDT. Skipping. 2024-07-29 19:51:25 - MultiBot - INFO - Short signal not triggered or short mode not enabled for symbol STMXUSDT. Skipping. 2024-07-29 19:51:25 - MultiBot - INFO - Evaluated action for new rotator symbol STMXUSDT: No action due to existing position or lack of clear signal. 2024-07-29 19:51:25 - MultiBot - INFO - No action taken for new rotator symbol STMXUSDT. 2024-07-29 19:51:25 - MultiBot - INFO - Using lorentzian signals
Tried with both commandline options using either single_coin or multi (V4).
Any suggestions on what might be the issue? Multi_bot.log shows normal operation but a trade is never opened where Exchange.log is reporting some errors.