JeeZues / TradeBot

GNU General Public License v3.0
4 stars 4 forks source link

Script frozen with no action overnight #3

Closed derrey closed 3 years ago

derrey commented 3 years ago

I was reviewing one of the terminals and when I woke up it looks like it had not done anything overnight. I had to press Ctrl C to break and restart. You can see from the timestamp that the last update before I touched it was 00:26:02 - then I stopped it and restarted at 11:29:30


00:01 - 2021-05-05 00:26:02

Using Binance Dave_Sub02 Futures USDT-M from exchange Binance Futures USDT-M

^CMargin Balance = $4779.17 ($78.39) : USDT Furures (Spot) = $5087.31 $(100.48) Timer expired Traceback (most recent call last): File "run.py", line 526, in ret = run_account(account, Binance_API_KEY, Binance_API_SECRET) File "/mnt/TradeBot/timeout.py", line 18, in wrapper result = func(*args, **kwargs) File "run.py", line 333, in run_account print(f"Margin Balance = ${totalMarginBalance:<.2f} (${totalMaintMargin:<.2f}) : USDT Furures (Spot) = ${availableBalanceUSDT:<.2f} $({usdt_spot_total_balance:<.2f})") File "/mnt/TradeBot/timeout.py", line 12, in _handle_timeout raise TimeoutError(error_message) timeout.TimeoutError: Timer expired

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "run.py", line 531, in print(e) File "/mnt/TradeBot/utils.py", line 55, in signal_handler print('\nYou pressed Ctrl+C!') RuntimeError: reentrant call inside <_io.BufferedWriter name=''> root@ubuntu20:/mnt/TradeBot# python3 run.py --show_deals --colors --auto --keep_running --keep_running_timer 15 --stop_at 1 --start_at .9 --pair_allowance 500 --binance_account_flag "Binance Dave_Sub02 Futures USDT-M" --do_transfer --transfer_at 5000 --transfer_delta 100 --my_top_pairs RSR SXP ZRX MATIC MKR SRM BAL MTL ZIL FTM --signal_top_pairs --bot_start_bursts 10^C root@ubuntu20:/mnt/TradeBot# root@ubuntu20:/mnt/TradeBot# python3 run.py --show_deals --colors --auto --keep_running --keep_running_timer 15 --stop_at 1 --start_at .9 --pair_allowance 500 --binance_account_flag "Binance Dave_Sub02 Futures USDT-M" --do_transfer --transfer_at 5000 --transfer_delta 100 --my_top_pairs RSR SXP ZRX MATIC MKR SRM BAL MTL ZIL FTM --signal_top_pairs --bot_start_bursts 10


Using Binance Dave_Sub02 Futures USDT-M from exchange Binance Futures USDT-M

Detected balance of $5113.02 over transfer limit $5000.0. Transfering $113.02 to spot. {'tranId': 57636943517} ^CMargin Balance = $4972.71 ($11.62) : USDT Furures (Spot) = $5113.02 $(100.48) reentrant call inside <_io.BufferedWriter name=''> Traceback (most recent call last): File "run.py", line 526, in ret = run_account(account, Binance_API_KEY, Binance_API_SECRET) File "/mnt/TradeBot/timeout.py", line 18, in wrapper result = func(*args, **kwargs) File "run.py", line 333, in run_account print(f"Margin Balance = ${totalMarginBalance:<.2f} (${totalMaintMargin:<.2f}) : USDT Furures (Spot) = ${availableBalanceUSDT:<.2f} $({usdt_spot_total_balance:<.2f})") File "/mnt/TradeBot/utils.py", line 55, in signal_handler print('\nYou pressed Ctrl+C!') RuntimeError: reentrant call inside <_io.BufferedWriter name=''> 00:10 - 2021-05-05 11:29:30

00:08 - 2021-05-05 11:29:32 ^C:07 - 2021-05-05 11:29:33 You pressed Ctrl+C! root@ubuntu20:/mnt/TradeBot# python3 run.py --show_deals --colors --auto --keep_running --keep_running_timer 15 --stop_at 1 --start_at .9 --pair_allowance 500 --binance_account_flag "Binance Dave_Sub02 Futures USDT-M" --do_transfer --transfer_at 5000 --transfer_delta 100 --my_top_pairs RSR SXP ZRX MATIC MKR SRM BAL MTL ZIL FTM --signal_top_pairs --bot_start_bursts 10


Using Binance Dave_Sub02 Futures USDT-M from exchange Binance Futures USDT-M

JeeZues commented 3 years ago

Hi, Can you format the code in the future so it's easier to read :) Are you seeing this on different terminals or just one? I've been running 3-4 accounts for weeks and never had this issue. They survived 3C going down, slowdowns, etc and have always recovered. If this is reproducible maybe you can add some debug output in some areas where you think the code might be stuck...

derrey commented 3 years ago

Sorry about the test in the message.. I didn't have much time to fix it.. :) I know it bugs me as well. It was just one account and seems to have happened when they did the 3C shutdown/update. I can't reproduce it, so that is why I grabbed everything that I could find on the screen. I will keep an eye on it as I am going to spin up a bunch more accounts over the next few days. Working my way up to 30-40 so I am trying to find a way to scale it and manage them.