Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
HELP PLS... 7800% returns doesn't seem right for MACD strategy

I am not a python expert or a financial expert by any means, although I have a basic enough understanding of both. I wrote a simple code where my goal was to buy the ES futures contract at the point where the short moving average crossed above the long moving average and to sell at the point where the long moving average moved above the short moving average. I ran a back test of this strategy which is posted here using historical data from December of 2017 to November of 2018.

I have three main unknowns about my strategy...

1) I am not sure if the ES i was trading was a stock with the ticker or whether it was in fact the ES (S&P 500 E mini futures contract) that I intended to trade.

2) If my strategy says to sell when the long moving average crossed above the short moving average why was i still experiencing losses in my percentage gain. If my strategy were running properly I should have locked in my gains when the curve began to go down, because my strategy is a 'long only' strategy... I dont want to hold any contracts when the Long moving average is above the short.

3) I read a previous post about this issue... but why did my log say that "my order for ES shares failed to be filled by the end of the day, and was cancelled" and what effect did that have on the performance of my algorithm?

Any help will be much appreciated!

Thank you