Excuse My stupidity but I'm totally new to this and suck at coding. This was the first thing I ever wrote in Quantopian. The program was originally supposed to buy a position when there was an upward trend and short when there was a downward trend. But instead there was an error and instead when there was a downward trend I bought more positions. Also a huge amount of the orders didn't go through. Again probably a stupid mistake but why would u be able to do this? Also why is the beta jump around anywhere from like 2 to 100? Does my algo somehow just do like a 1:1000 leverage? It for some reason doesn't even track the spy etf I'm using. There are lots of times where the etf drops yet my algo makes 100%.