Hi there,
I am new here. I try to write a momentum strategy on SPY. Basically, I long the SPY when 50-days-average goes up across the 200-days-average and go short when 50-days-average goes down across the 200-days-average. It should not be hard to write it. I wrote the draft but the results are very surprising. Something must be wrong. Could any expert help me with my code? Thanks a lot.```
James