Here is the bad news...
The 50-day moving average is calculated at the end of day closing. It included "today's" closing.
Let's say there are no fees for buying, shorting, and selling SPY (as a proxy for the SP500) and you buy the SPY at the end of day if the SPY is above its 50-day moving average, and you short the SPY at the end-of-day if the SPY is below its 50-day moving average. That is, all trading is done at the end of day.
If, following the above rules, gains and losses are only totaled for the end-of-day close to the following end-of-day close. The return becomes very slightly positive for the "long" days and decidedly negative for the "short" days.
In other words, if you attempt to actually trade at the close of market based upon the above rules, you lose 3X money if you short as compared to long. If you just go long, based upon that rule, then you will do better just staying in the market long only.
If instead of following the above rules, you take all daily gains/losses for the SP500 at the end of day and assign those to long or short depending upon whether that day's CLOSE is above or below the 50-day moving average, then yes, your numbers work out. But, of course, this is "looking ahead" to each day's end-of-day close. Simply, nearly all the money is made on the turns -- if you can predict them a few hours before close.... Wish I could...