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) total = 0 if any(e8 > e13): total += 1 else: total -= 1 if any(e13 > e21): total += 1 else: total -= 1 if any(e21 > e55): total += 1 else: total -= 1 print("Ema 8 =", e8) print("Ema 13 =", e13) print("Ema 21 =", e21) print("Ema 55 =", e55) print("rating =", total)Of course, I'm waiting for help, sorry for the delay. I had to go out for an unexpected reason, the final code is by, if I don't use "any" it gives the error I mentioned, when I use it, it doesn't return the correct result no matter what I do.
Why is the if construct not calculating correctly?
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Is it possible to multi line a Basic Function Construct line statement? If so how? | BrandonKastning | 7 | 433 |
May-23-2024, 03:02 PM Last Post: deanhystad |
|
Building command in a looping construct | DennisT | 3 | 2,024 |
Sep-08-2020, 06:32 PM Last Post: DennisT |
|
shortening an elif construct | Skaperen | 10 | 5,672 |
Jul-24-2018, 07:06 AM Last Post: Skaperen |
|
Best construct? Array, class, other? | PappaBear | 1 | 3,049 |
May-10-2017, 06:02 PM Last Post: nilamo |
Users browsing this thread: 1 Guest(s)