whittlem / pycryptobot

Python Crypto Bot (PyCryptoBot)
Apache License 2.0
1.97k stars 741 forks source link

AttributeError("'AppState' object has no attribute 'buy_wait_count'") #605

Closed crapher closed 2 years ago

crapher commented 2 years ago

Describe the bug When I try to run the bot I am receiving the error

Restarting application after exception: AttributeError("'AppState' object has no attribute 'buy_wait_count'") AttributeError("'AppState' object has no attribute 'buy_wait_count'")

To Reproduce Steps to reproduce the behavior: Run the bot with the following configuration

python3 pycryptobot.py --startmethod scanner --exchange binance --market OGUSDT --logfile './logs/binance-OGUSDT-2021-12-05.log' 
--------------------------------------------------------------------------------
|                              Python Crypto Bot                               |
--------------------------------------------------------------------------------
|                Release : v4.5.2                                              |
--------------------------------------------------------------------------------
|               Bot Mode : TEST - test trades using dummy funds :)             |
|            Bot Started : 2021-12-05 07:42:14.825949                          |
|               Exchange : binance                                             |
================================================================================
|            No Sell Max : 3.0%  --nosellmaxpcnt  <pcnt>                       |
|            No Sell Min : -10.0%  --nosellminpcnt  <pcnt>                     |
|     Trailing Stop Loss : -1.7%  --trailingstoploss  <pcnt>                   |
| Trailing Stop Loss Trg : 3.7%  --trailingstoplosstrigger                     |
|           Sell At Loss : False  --sellatloss                                 |
|     Sell At Resistance : False  --sellatresistance                           |
|        Trade Bull Only : False  --disablebullonly                            |
|    Allow Buy Near High : True  --disablebuynearhigh                          |
|           Use Buy MACD : True  --disablebuymacd                              |
|            Use Buy EMA : False  --disablebuyema                              |
|            Use Buy OBV : False  --disablebuyobv                              |
|      Use Buy Elder-Ray : False  --disablebuyelderray                         |
|     Sell Fibonacci Low : False  --disablefailsafefibonaccilow                |
|   Candlestick Reversal : False  --disableprofitbankreversal                  |
|               Telegram : True  --disabletelegram                             |
|   Telegram trades only : False --telegramtradesonly                          |
|    Telegram error msgs : True --disabletelegramerrormsgs                     |
|                    Log : True  --disablelog                                  |
|                Tracker : True  --disabletracker                              |
|       Auto restart Bot : True  --autorestart                                 |
|             Web Socket : False  --websocket                                  |
| Insufficient Funds Log : True  --enableinsufficientfundslogging              |
| Log Buy and Sell order : False  --logbuysellinjson                           |
|           Max Buy Size : 20.0  --buymaxsize <size>                           |
================================================================================

Expected behavior Run the bot without error

Screenshots image

Desktop (please complete the following information):

Additional context I solved the problem by adding the line

self.buy_wait_count = 0

to the class AppState in the AppState.py file.

crapher commented 2 years ago

Fixed on PR #606