import time
import requests
def get_price(symbol):
"""Abfrage des aktuellen Preises einer Kryptowährung."""
url = f"api.coinmarketcap.com/v2/ticker/{symbol}/?convert=EUR"
response = requests.get(url)
data = response.json()
return data['data']['quotes']['EUR']['price']
def buy_sell_strategy(symbol, buy_threshold, sell_threshold):
"""Automatisierte Handelsstrategie zum Kauf und Verkauf von Kryptowährungen."""
current_price = get_price(symbol)
if current_price < buy_threshold:
print(f"Kaufe {symbol} zu einem Preis von {current_price:.2f} EUR.")
elif current_price > sell_threshold:
print(f"Verkaufe {symbol} zu einem Preis von {current_price:.2f} EUR.")
import requests
def get_price(symbol):
"""Abfrage des aktuellen Preises einer Kryptowährung."""
url = f"api.coinmarketcap.com/v2/ticker/{symbol}/?convert=EUR"
response = requests.get(url)
data = response.json()
return data['data']['quotes']['EUR']['price']
def buy_sell_strategy(symbol, buy_threshold, sell_threshold):
"""Automatisierte Handelsstrategie zum Kauf und Verkauf von Kryptowährungen."""
current_price = get_price(symbol)
if current_price < buy_threshold:
print(f"Kaufe {symbol} zu einem Preis von {current_price:.2f} EUR.")
elif current_price > sell_threshold:
print(f"Verkaufe {symbol} zu einem Preis von {current_price:.2f} EUR.")
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
