The below algorithm seeks to use current and previous MACD/EMA/Price data points to identify crossovers and trade accordingly - all without the use of rolling windows. There are two scheduled events: one to ensure trading only occurs for the period between 0900 and 1555 (EST) and that all positions are closed out at 1555. Not sure why it will not calculate properly, although I suspect It has something to do with the way I am treating the self.Securities[self.X].How and .Low values.