Hey Quantopians,
I've been fiddling around with a code to sell when the slow trima(triangular moving average) passes over the fast average. The code sells when the fast passes over the slow. BUT whenever I backtest I get this error reagardless of stock.
OrderNonSecurity: 0035 Attempt to order [[Security(24, symbol='AAPL', security_name='APPLE INC', exchange='NASDAQ GLOBAL SELECT MARKET', start_date=datetime.datetime(1993, 1, 4, 0, 0, tzinfo=), end_date=datetime.datetime(2014, 7, 18, 0, 0, tzinfo=), first_traded=None)]], which is not a security. You must place orders with a Security object. You can construct a Security by calling sid(123).
Does anyone know what's going on? If I take out the sell lines the code works fine. I'll add the backtest to this post.
Ignore the normal moving average, it's just for reference.
Thanks everyone.