Simple 50/200MA Crossover Strategy for $SPY, no short component
Simple 50/200MA Crossover Strategy for $SPY, no short component
Thank you for this code, helpful in getting started with this API. A question for Quantopian, when are moving averages available for trading decisions versus the start dates for the backtest? It appears that the benchmark starts right away (at the start date) but the moving average for the stock to be compared is computed after X periods from the start date so there is a delay when a trade can be made (e.g. 50 days for a 50 day MA). Therefore, the benchmark has a running start, 50 days of trading activity, before the comparison, giving it a positive advantage if trading up or will lag behind if trading down. Is this accurate and, if so, can this be corrected?