Mar-20-2022, 04:26 AM
(This post was last modified: Mar-20-2022, 04:26 AM by deanhystad.)
Your if statements sets total = 0 or 1, never 2. Total makes it sound like there should be adding, but there is no adding going on. Have you changed your code? If so, please post new code.
My guess is you want something like this:
My guess is you want something like this:
bars = exchange.fetch_ohlcv(symbol, timeframe=zamanAraligi, since=None, limit=500) df = pd.DataFrame(bars, columns=["timestamp", "open", "high", "low", "close", "volume"]) #ema control e8 = ta.ma("ema", df.close, length=8) e13 = ta.ma('ema', df.close, length=13) e21 = ta.ma('ema', df.close, length=21) e55 = ta.ma('ema', df.close, length=55) #ema rating total = 0 if any(e8 > e13): total += 1 if any(e13 > e21): total += 1 if any(e21 > e55): total += 1 index = len(df.index) -2 print("Ema 8 =", e8[index]) print("Ema 13 =", e13[index]) print("Ema 21 =", e21[index]) print("Ema 55 =", e55[index]) print("rating =", total)