from binance.client import Client
import pandas as pd
client = Client('api-key', 'api-secret')
orders=client.get_order_book(symbol='BTCUSDT')
candles = client.get_klines(symbol='BTCUSDT', interval=Client.KLINE_INTERVAL_30MINUTE)
prices = pd.DataFrame(prices)RSI için formul
RSI = 100 - 100 / (1 + RS)
RS = Average gain of last 14 trading days / Average loss of last 14 trading days
def RSI(series, period): delta = series.diff().dropna() u = delta * 0 d = u.copy() u[delta > 0] = delta[delta > 0] d[delta < 0] = -delta[delta < 0] u[u.index[period-1]] = np.mean( u[:period] ) #first value is sum of avg gains u = u.drop(u.index[:(period-1)]) d[d.index[period-1]] = np.mean( d[:period] ) #first value is sum of avg losses d = d.drop(d.index[:(period-1)]) rs = pd.stats.moments.ewma(u, com=period-1, adjust=False) / \ pd.stats.moments.ewma(d, com=period-1, adjust=False) return 100 - 100 / (1 + rs)**bana sadece cmd için değer lazım. matplot ile çizdirmeyeceğim . o değeri alım satım değerinde kullanacağım.