How do I replicate SuperTrend indicator from Binance website?

2k views Asked by At

I'm trying to implement (in Python) SuperTrend indicator that you can see on Binance website if you click on TradingView tab and add it here

So far I've tried multiple various ways of calculating it as well as TA-Lib and pandas-ta. None of those are exactly the same with the Binance version. What am I missing?

I'm feeding the indicator from closed candles data(Klines with X parameter) with 1000 samples like so:

st_df = ta.supertrend(high=ticker_df['high'].tail(1000),\
low=ticker_df['low'].tail(1000), close=ticker_df['price'].tail(1000), \
length=10, multiplier=3)

My dataframe is fine - I'm getting exactly the same(as shown on Binance) EMA and other indicators with pandas-ta from it.

2

There are 2 answers

1
r0ck On

try as it is

st1 = df.ta.supertrend(period=10, multiplier=2)['SUPERT_7_2.0'];
0
r0ck On
st= ta.supertrend(df['high'],df['low'],df['close'],10,2)
#print(st);
df= df.join(st);
print(df)