Too much, buddy

EDIT: I'd recommend to change Buddy's policy to post a price update only if it moved by a certain amount of dollars.
Post a buddychart only if price moves more than 1% either direction since last post. Else wait another 60 minutes and check again.
import ccxt
import time
# Initialize the exchange
exchange = ccxt.binance() # You can replace 'binance' with your preferred exchange
# Function to get current Bitcoin price
def get_bitcoin_price():
ticker = exchange.fetch_ticker('BTC/USDT')
return ticker['last']
# Function to make a post
def make_post(price_change):
# Replace this with your actual post logic
print(f"Bitcoin price changed by {price_change}%")
# Main loop
while True:
try:
# Get the current price
current_price = get_bitcoin_price()
# Check if there was a 1% change from the last post
if 'last_price' in locals() and abs(current_price - last_price) / last_price > 0.01:
make_post(abs(current_price - last_price) / last_price * 100)
# Update last_price
last_price = current_price
except Exception as e:
print(f"An error occurred: {e}")
# Wait for 60 minutes
time.sleep(60 * 60)
This would also make @philipma1957 happy.
damn right it would I could extend my lead over that piece of shit bot mother fucker.