I attempted to code a very poorly written EWMA algorithm. Frankly speaking I was just happy to see the algorithm itself work. Now that I have something working, I was wondering if someone could explain to me why the algorithm itself is faulty either fundamentally or within the code as the returns are horrendous. Anything is greatly appreciated, and I apologize if I lack understanding I'm fairly new to the whole Quantopian thing.