I used your code: def quantity():
    mark_price_data = client.ticker_price(symbol=symbol)
    mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
    token_price = mark_price    # token price in dollars
    amount_in_dollars = usdt_balance    # amount in dollars
    number_of_tokens = amount_in_dollars / token_price    # calculating number of tokens
    number_of_tokens *= 50    # multiplying number of tokens by 50
    return number_of_tokens    # printing the result

while True:
    lookback = 10080
    df = get_klines(symbol, interval, lookback)

    if df is not None:
        signals = signal_generator(df)
        number_of_tokens = quantity
        mark_price_data = client.ticker_price(symbol=symbol)
        mark_price = float(mark_price_data['price']) if 'price' in mark_price_data else 0.0
        print(f"The signal time is: {dt.datetime.now().strftime('%Y-%m-%d %H:%M:%S')} Price: [{mark_price}] - Signals: {signals}")

    if signals == ['buy']:
        try:
            account_info = client.account()
            balance = number_of_tokens

            quantity = balance
            order = client.new_order(
                symbol=symbol,
                side='BUY',
                type='MARKET',
                quantity=quantity
            )
            print("Long order executed!")

        except BinanceAPIException as e:
            print(f"Error executing long order: {e.message}")

        time.sleep(1)

    if signals == ['sell']:
        try:
            account_info = client.account()
            balance = number_of_tokens

            quantity = balance
            order = client.new_order(
                symbol=symbol,
                side='SELL',
                type='MARKET',
                quantity=quantity
            )
            print("Short order executed!")

        except BinanceAPIException as e:
            print(f"Error executing short order: {e.message}")

        time.sleep(1)

    time.sleep(1)

But I getting ERROR: Traceback (most recent call last):
  File "c:\Users\Alan\.vscode\jew_bot\jew_bot\jew_bot.py", line 217, in <module>
    order = client.new_order(
            ^^^^^^^^^^^^^^^^^
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\binance\um_futures\account.py", line 113, in new_order
    return self.sign_request("POST", url_path, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\binance\api.py", line 83, in sign_request
    return self.send_request(http_method, url_path, payload, special)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\binance\api.py", line 118, 
in send_request
    self._handle_exception(response)
  File "C:\Users\Alan\AppData\Roaming\Python\Python311\site-packages\binance\api.py", line 172, 
in _handle_exception
    raise ClientError(status_code, err["code"], err["msg"], response.headers)
binance.error.ClientError: (400, -1102, "Mandatory parameter 'quantity' was not sent, was empty/null, or malformed.", {'Date': 'Tue, 22 Aug 2023 12:17:25 GMT', 'Content-Type': 'application/json', 'Content-Length': '97', 'Connection': 'keep-alive', 'Server': 'Tengine', 'x-mbx-used-weight-1m': '-1', 'x-mbx-order-count-10s': '1', 'x-mbx-order-count-1m': '1', 'x-response-time': '2ms', 
'Access-Control-Allow-Origin': '*', 'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS'})