$SAMSUNGEM
import time
import pandas as pd
import ta
from binance.client import Client
# 1. API Keys dalo
api_key = "TUMHARA_API_KEY"
api_secret = "TUMHARA_API_SECRET"
client = Client(api_key, api_secret)
symbol = "SAMSUNGUSDT"
quantity = 0.1 # 0.1 SAMSUNG = ~16 USDT
def get_data():
klines = client.get_klines(symbol=symbol, interval=Client.KLINE_INTERVAL_1HOUR, limit=50)
df = pd.DataFrame(klines, columns=['time','open','high','low','close','vol','c1','c2','c3','c4','c5','c6'])
df['close'] = df['close'].astype(float)
rsi = ta.momentum.RSIIndicator(df['close']).rsi().iloc[-1]
price = df['close'].iloc[-1]
return float(price), float(rsi)
while True:
price, rsi = get_data()
print(f"SAMSUNG Price: {price} USDT | RSI: {rsi}")
# 2. Logic: Sasti ho to buy, mehngi ho to sell
if rsi < 35:
print("Buy Signal - Price Low")
# order = client.order_market_buy(symbol=symbol, quantity=quantity)
elif rsi > 65:
print("Sell Signal - Price High")
# order = client.order_market_sell(symbol=symbol, quantity=quantity)
time.sleep(3600) # 1 ghante baad check karega
import time
import pandas as pd
import ta
from binance.client import Client
# 1. API Keys dalo
api_key = "TUMHARA_API_KEY"
api_secret = "TUMHARA_API_SECRET"
client = Client(api_key, api_secret)
symbol = "SAMSUNGUSDT"
quantity = 0.1 # 0.1 SAMSUNG = ~16 USDT
def get_data():
klines = client.get_klines(symbol=symbol, interval=Client.KLINE_INTERVAL_1HOUR, limit=50)
df = pd.DataFrame(klines, columns=['time','open','high','low','close','vol','c1','c2','c3','c4','c5','c6'])
df['close'] = df['close'].astype(float)
rsi = ta.momentum.RSIIndicator(df['close']).rsi().iloc[-1]
price = df['close'].iloc[-1]
return float(price), float(rsi)
while True:
price, rsi = get_data()
print(f"SAMSUNG Price: {price} USDT | RSI: {rsi}")
# 2. Logic: Sasti ho to buy, mehngi ho to sell
if rsi < 35:
print("Buy Signal - Price Low")
# order = client.order_market_buy(symbol=symbol, quantity=quantity)
elif rsi > 65:
print("Sell Signal - Price High")
# order = client.order_market_sell(symbol=symbol, quantity=quantity)
time.sleep(3600) # 1 ghante baad check karega