0

Hello I'm getting this error when using telepot:

Connection aborted.' ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forced to be aborted by the remote host', None, 10054, None)).

This is the code I am using:

import telepot

import requests.exceptions



token = veri["token_tl"]
alici = int(veri["alici_tl_pSargrup"])
bot = telepot.Bot(token)
def longEnter(alinacak_miktar):
    order = exchange.create_market_buy_order(symbol, alinacak_miktar)
    entryPrices.append(float(order["price"]))
    entryAmounts.append(float(order["amount"]))
if longPosition == False and df['pSar_Up'][len(df.index) - 1] > 0 and df['pSar_Down'][len(df.index) - 2] > 0:
    qty = ((totalMoney / 100) * percentageOfTradeMoney) / currentPrice
    longEnter(qty)
    entryPrice = float(entryPrices[len(entryPrices) - 1])
    amount = float(entryAmounts[len(entryAmounts) - 1])
    longPosition = True
    print("LONG ENTER")

    try:
        msj3 = ("Long pozisyona girildi!. Giriş fiyatı = " + str(entryPrice))
        bot.sendMessage(alici, msj3)

    except (requests.exceptions.ConnectionError,ConnectionAbortedError) as Error5:
        print("[ERROR] ", Error5)
        pass

0 Answers0