wrong notifications from my applet ( IFTTT ) (Python trading script)

25 Views Asked by At

I’m trying to set a notification throw the webhook, using IFTTT, but I’m keep receiving wrong notifications: {{value1}}

the idea that i want to auto from my applet to read ( message = f"stop or message = f"sell........ ) automatically not typing it manually, what i did wrong?

note: the applet configure as ( if webhook ) then (notification for my IFTTT app with message = {{value1}}

# Function to send a notification
def send_notification(message):
    url = f'https://maker.ifttt.com/trigger/"event"/json/with/key/"KEy"'
    payload = {
        'value1': message
    }
    response = requests.post(url, json=payload)

    if response.status_code == 200:
        print('Notification sent successfully.')
    else:
        print(f'Failed to send notification. Status code: {response.status_code}')

message 1: and message 2

                    profit = price - buy_prices\[symbol\]
                    message = f"Sell order placed for {symbol} at {price} (Profit: {profit})"
                    print(message)
                    send_notification(message)

                    loss = buy_prices\[symbol\] - price
                    message = f"Stop-loss triggered for {symbol} at {price} (Loss: {loss})"
                    print(message)
                    send_notification(message)
0

There are 0 best solutions below