freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
28.15k stars 6.03k forks source link

freqtrade.commands.trade_commands - ERROR - 'symbol' #7262

Closed myNextCoder closed 2 years ago

myNextCoder commented 2 years ago

Describe your environment

Your question

According to ticket #7256 I updated to the current FT version at that time. The error remains, and still stops the bot, but it is a different one, instead of last, it is named symbol:

2022-08-19 22:55:40,261 - freqtrade.worker - INFO - Bot heartbeat. PID=2812, version='2022.8.dev', state='RUNNING' 2022-08-19 22:55:43,230 - freqtrade.commands.trade_commands - ERROR - 'symbol' 2022-08-19 22:55:43,230 - freqtrade.commands.trade_commands - ERROR - Fatal exception! Traceback (most recent call last): File "C:\Users\a1\Freqtrade\freqtrade\commands\trade_commands.py", line 19, in start_trading worker.run() File "C:\Users\a1\Freqtrade\freqtrade\worker.py", line 74, in run state = self._worker(old_state=state) File "C:\Users\a1\Freqtrade\freqtrade\worker.py", line 114, in _worker self._throttle(func=self._process_running, throttle_secs=self._throttle_secs) File "C:\Users\a1\Freqtrade\freqtrade\worker.py", line 139, in _throttle result = func(*args, **kwargs) File "C:\Users\a1\Freqtrade\freqtrade\worker.py", line 152, in _process_running self.freqtrade.process() File "C:\Users\a1\Freqtrade\freqtrade\freqtradebot.py", line 187, in process self.active_pair_whitelist = self._refresh_active_whitelist(trades) File "C:\Users\a1\Freqtrade\freqtrade\freqtradebot.py", line 255, in _refresh_active_whitelist self.pairlists.refresh_pairlist() File "C:\Users\a1\Freqtrade\freqtrade\plugins\pairlistmanager.py", line 93, in refresh_pairlist pairlist = pairlist_handler.filter_pairlist(pairlist, tickers) File "C:\Users\a1\Freqtrade\freqtrade\plugins\pairlist\IPairList.py", line 112, in filter_pairlist if not self._validate_pair(p, tickers[p] if p in tickers else {}): File "C:\Users\a1\Freqtrade\freqtrade\plugins\pairlist\PrecisionFilter.py", line 55, in _validate_pair self.log_once(f"Removed {ticker['symbol']} from whitelist, because " KeyError: 'symbol' 2022-08-19 22:55:43,230 - freqtrade.commands.trade_commands - INFO - worker found ... calling exit 2022-08-19 22:55:43,230 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': status, 'status': 'process died'} 2022-08-19 22:55:43,667 - freqtrade.freqtradebot - INFO - Cleaning up modules ... 2022-08-19 22:55:43,667 - freqtrade.rpc.rpc_manager - INFO - Sending rpc message: {'type': warning, 'status': "3 open trades active.\n\nHandle these trades manually on Gate.io, or '/start' the bot again and use '/stopbuy' to handle open trades gracefully. \nNote: Trades are simulated (dry run)."} 2022-08-19 22:55:43,839 - freqtrade.rpc.rpc_manager - INFO - Cleaning up rpc modules ... 2022-08-19 22:55:43,839 - freqtrade.rpc.rpc_manager - INFO - Cleaning up rpc.telegram ... 2022-08-19 22:55:43,839 - apscheduler.scheduler - INFO - Scheduler has been shut down 2022-08-19 22:56:02,401 - freqtrade.exchange.exchange - INFO - Closing async ccxt session.

End of code.

Probably, since a different error was fired, it is now easier to find out the real reason behind this case, true or not? Still the type of bot including stake is identical as described in the referred tickets.

Ask the question you have not been able to find an answer in the Documentation

xmatthias commented 2 years ago

this would suggest a partially empty or incomplete response - or one that was generated by an outdated ccxt version (which you seem to omit in every issue you open ...). Are you using any "special" config - like some proxy or anything that will be messing with data at a networking level?

myNextCoder commented 2 years ago

Since you gave me the advice to update CCXT, I have added the CCXT update command to my FT installation list, so everytime I install FT, I finally update CCXT. Due to the brand-new FT version yesterday, the response of CCXT update was ". . .already satisfied. . .".

I have one interesting detail to tell you: My gate.io USDT bots which stop, have the pairs list state of June 9th. By incrementing the AgeFilter regularly, no newer token appears. Now I have added one test USDT bot, with pairs list state of August 19th. So I guess, there might appear newer coins on the white list. This test bot isn't online very long, but it didn't generated this error, and did not stop until now. Remember, that even the stopping bots are running fine, as soon as I configure "number_assets": 0, with all pairs blacklisted. And, as I told you, all bots with BTC or ETH stake, or FTX tokenized stocks bots, never stop.

My current config runs since June with a command line like, no issue before this error:

freqtrade trade --config \X\zf\c\telegram_gateio_nfiX_config1.json --config \X\zf\c\gateio_pf_8.json --config \X\zf\c\gateio_pairs_1_2_2.json --config \X\zf\c\BotName1.json --config \X\zf\c\placeholder_1.json --starting-balance 10000

The first file contains the main config, while the 2nd only the pairlist filters, the 3. are the pairs in VolumePairList, the 4. is only the telegram token and chatID. Placeholder file is usually empty, I can add any urgent content, which will override the other files.

I have no configured proxy settings, API is disabled, and 'freqtrade install-ui' is NOT installed. As you see, my files are on a local network share, during the last months I never had an issue, since the files are always reachable.

After installing FT, I always install:

pip install ta, pip install pandas_ta, pip install finta, and as I told you: pip install -U ccxt.

I don't understand, why the behavior of the error is the same, but changed from 'last' to 'symbol'. This shows of course, that the new FT version treats the problem differently. I hope, you have a further idea, how to analyze.

xmatthias commented 2 years ago

Due to the brand-new FT version yesterday, the response of CCXT update was ". . .already satisfied. . .".

what's often needed for reproduction is an exact version. I'd not recommend to use pip install -U ccxt - but use the pinned version (in requirements.txt) instead. Obviously when using 0 pairs in the whitelist, the error won't appear (the whole Pairlist will no longer be called, then).

your best bet at this point may be running the bot with -vv- assuming the error reproduces quite fast. That mode will generate a LOT of logs (it enables ccxt verbose logging) - but we'll need to know the "bad" response from the exchange to investigate this further.

myNextCoder commented 2 years ago

I thank you for your great help. I follow your steps, since of course with 0 assets I won't generate any profit ;) I have to interrupt my work for some hours. Tell me, if we leave the ticket open, which is perfect for me, or if you want me to open a new one with my continuation, referring to this ticket.

xmatthias commented 2 years ago

it's not closed, really (but it's a slightly different error than the previous ones - although the cause is likely the same).

myNextCoder commented 2 years ago

I am about to setup the test-scenario according to your advice: Is 'exact' version the current FT stable version? Since I should use the pinned ccxt update in requirements.txt, I guess, that after installing FT, this file is used, and therefore, I have ccxt in the desired state, correct? After I know this I start a test-bot with -vv or even with -vvv, not to miss anything.

xmatthias commented 2 years ago

Use develop for a test scenario. -vv will suffice.

myNextCoder commented 2 years ago

The test is running since 3 hours, lets grow the logfile to already 10 MB. Probably it smells my intention and lets me wait ;) I post the results asap.

myNextCoder commented 2 years ago

Attached you find the three generated log-files, their order can be read from the timestamps. If there is to much data, and if you want me to extract specific parts, don't hesitate, to tell me, what fragments you exactly need from the files. At the very end you still find our known error. Of course the bot stopped 'as usual' logs.zip .

myNextCoder commented 2 years ago

I hope, I can help, to solve the issue, telling you, that with StaticPairList, the bots don't stop. In that case, the pairlist-file only contains elements under whitelist, the blacklist is empty.

xmatthias commented 2 years ago

I'm running a bot now since several days trying to recreate this - but it's simply not happening ...

myNextCoder commented 2 years ago

First of all I thank you for your support, running the bot since multiple days. If this is ok for you, I send you my config files at the beginning of the next week (I am currently out of office).

xmatthias commented 2 years ago

In my configuration - it'll be hit on every iteration - for all USDT pairs - and it's been stable over the last few days.

SIGEIV commented 2 years ago

Selling crypto wallets

myNextCoder commented 2 years ago

Sorry, for this delay, now my files are reachable again. Due to the fact, that only volume pairlists stopped the bots, I send you these two files, which might stop your test-bot, as you start it under VolumePairlist. gateio_bot_stops_on_vol_pairs.zip

xmatthias commented 2 years ago

you've got ... quite some pairs blacklisted 😆 i doubt this will make a difference though - as my config was a plain "all pairs" - with .*/USDT as static pairlist, followed by a Precision filter - running since almost a week now without changes.

I'll give your config a try today (without the blacklist stuff) - but i don't expect it to have an impact. How long until you normally get that error?

xmatthias commented 2 years ago

While i've closed this issue now by avoiding the error - i'm still unable to get this error even once. As such, we can't really confirm the root-cause (why do we get an empty dict in the first place).