goranjovic55 / Binance-Trading-Bot

Binance trading bot based CyberPunkMetalHeads Binance-volatility-trading-bot
MIT License
97 stars 37 forks source link

Error while selling #76

Closed chromatic6 closed 3 years ago

chromatic6 commented 3 years ago

Sometimes there's an error while selling and the session abort.

[2021-07-26 11:30:23] TP or SL reached, selling 44.04 COCOSUSDT. Bought at: 0.68340000 (Price now: 0.68280000)  - -0.09% - Est: -0.03 USDT
Traceback (most recent call last):
  File "/home/jay/Bureau/Binance-Trading-Bot/Binance_Detect_Moonings.py", line 212, in <module>
    trade_crypto()
  File "/home/jay/Bureau/Binance-Trading-Bot/bot/trade.py", line 472, in trade_crypto
    coins_sold = sell_coins()
  File "/home/jay/Bureau/Binance-Trading-Bot/bot/trade.py", line 348, in sell_coins
    report_struct['report'] = REPORT
UnboundLocalError: local variable 'REPORT' referenced before assignment

The coin is sold but at next start it's still referenced in coins_bought.json and the slot is still counted as used in session_info.json.

phroton commented 3 years ago

same here

[2021-08-06 18:07:19] TP or SL reached, selling 0.735 NEOUSDT. Bought at: 44.18900000 (Price now: 44.55800000)  - 0.84% - Est: 0.27 USDT
Traceback (most recent call last):
  File "Binance_Detect_Moonings.py", line 212, in <module>
    trade_crypto()
  File "/home/fmc/dev/Binance-Trading-Bot/bot/trade.py", line 473, in trade_crypto
    coins_sold = sell_coins()
  File "/home/fmc/dev/Binance-Trading-Bot/bot/trade.py", line 349, in sell_coins
    report_struct['report'] = REPORT
UnboundLocalError: local variable 'REPORT' referenced before assignment
goranjovic55 commented 3 years ago

will look into it tmorrow

goranjovic55 commented 3 years ago

actually added REPORT = "" before any report reference at begining of sell now it should be ok