This is the final form of the code, but there is no change in the situation. What I want to do is if the result from the if command is True, if it is 1, if it is False, add -1 to the total and create a rating, but unfortunately I could not succeed.
Ema 13 = 396.95757807407034 this has to be -1
Ema 21 = 397.48536512624753 this has to be -1
Ema 55 = 397.86351648654266
rating = 1 this has to be -3
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 total1 = 0 index = len(df.index) - 1 if (float(e8[index])) - float(e13[index] == True): total1 += 1 if (float(e8[index]) - float(e13[index]) == False): total1 -= 1 if (float(e13[index]) - float(e21[index]) == True): total1 += 1 if (float(e13[index]) - float(e21[index]) == False): total1 -= 1 if (float(e21[index]) - float(e55[index]) == True): total1 += 1 if (float(e21[index]) - float(e55[index]) == False): total1 -= 1 print("Ema 8 = " + str(e8[len(df.index) - 1])) print("Ema 13 = " + str(e13[len(df.index) - 1])) print("Ema 21 = " + str(e21[len(df.index) - 1])) print("Ema 55 = " + str(e55[len(df.index) - 1])) print("rating = " + str(total1))Ema 8 = 396.7588162749833 this has to be -1
Ema 13 = 396.95757807407034 this has to be -1
Ema 21 = 397.48536512624753 this has to be -1
Ema 55 = 397.86351648654266
rating = 1 this has to be -3