CyberPunkMetalHead / Binance-volatility-trading-bot

This is a fully functioning Binance trading bot that measures the volatility of every coin on Binance and places trades with the highest gaining coins If you like this project consider donating though the Brave browser to allow me to continuously improve the script.
MIT License
3.39k stars 775 forks source link

Question about test order #50

Closed O-Mutt closed 3 years ago

O-Mutt commented 3 years ago

This code references placing real orders if the test order does not throw: https://github.com/CyberPunkMetalHead/Binance-volatility-trading-bot/blob/172cc44e33078f9fd33de3a7bace60f1fa8725a0/Binance%20Detect%20Moonings.py#L223-L238

In my test runs the throw crashes the app, is this expected behavior? I wouldn't expect to handle this code with a uncaught exception but instead log the exception

e.g.

if TESTNET:
    # create test order before pushing an actual order
    try:
        test_order = client.create_test_order(symbol=coin, side='BUY', type='MARKET', quantity=volume[coin])

    except Exception as e:
        print(f'An error occurred placing the test order {e}')

    #try to create a real order if the test orders did not raise an exception
    try:
        buy_limit = client.create_order(
            symbol = coin,
            side = 'BUY',
            type = 'MARKET',
            quantity = volume[coin]
        )

     # error handling here in case position cannot be placed
      except Exception as e:
          print(e)
djhashh commented 3 years ago

bump

getsec commented 3 years ago

@O-Mutt This still happening?

getsec commented 3 years ago

No response. If happening. I need to know the exception please.